partim / domain Goto Github PK
View Code? Open in Web Editor NEWA DNS library for Rust
License: MIT License
A DNS library for Rust
License: MIT License
When I try to build latest commit 9958a54 with nightly rustc 1.30.0-dev (52c785bfc 2018-08-08) I get errors:
Compiling domain v0.3.0 (file:///mnt/another/srcs/GIT/domain)
Running `rustc --crate-name domain src/lib.rs --crate-type lib --emit=dep-info,link -C opt-level=3 -C metadata=87fc5076fb9ca965 -C extra-filename=-87fc5076fb9ca965 --out-dir /mnt/another/srcs/GIT/domain/target/release/deps -L dependency=/mnt/another/srcs/GIT/domain/target/release/deps --extern base64=/mnt/another/srcs/GIT/domain/target/release/deps/libbase64-0361a0558368b386.rlib --extern bytes=/mnt/another/srcs/GIT/domain/target/release/deps/libbytes-cd12887ded74a0dd.rlib --extern chrono=/mnt/another/srcs/GIT/domain/target/release/deps/libchrono-5f2afb162ca6089a.rlib --extern failure=/mnt/another/srcs/GIT/domain/target/release/deps/libfailure-b9c1c6cfa783236d.rlib --extern failure_derive=/mnt/another/srcs/GIT/domain/target/release/deps/libfailure_derive-9202c4472f7e8fed.so --extern futures=/mnt/another/srcs/GIT/domain/target/release/deps/libfutures-ff1458c073f460e0.rlib --extern rand=/mnt/another/srcs/GIT/domain/target/release/deps/librand-ff601df1196eaccb.rlib --extern tokio=/mnt/another/srcs/GIT/domain/target/release/deps/libtokio-b7e2d3be332df088.rlib -L native=/mnt/another/srcs/GIT/domain/target/release/build/backtrace-sys-8f11f1bd0862fc3f/out`
warning: unnecessary parentheses around function argument
--> src/utils/base32.rs:49:25
|
49 | f.write_char(ch((chunk[4] & 0x1F)))?; // 7
| ^^^^^^^^^^^^^^^^^ help: remove these parentheses
|
= note: #[warn(unused_parens)] on by default
warning: use of deprecated item 'std::ascii::AsciiExt': use inherent methods instead
--> src/bits/charstr.rs:28:5
|
28 | use std::ascii::AsciiExt;
| ^^^^^^^^^^^^^^^^^^^^
|
= note: #[warn(deprecated)] on by default
warning: use of deprecated item 'std::ascii::AsciiExt::to_ascii_lowercase': use inherent methods instead
--> src/bits/charstr.rs:292:25
|
292 | self.iter().map(AsciiExt::to_ascii_lowercase)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated item 'std::ascii::AsciiExt::to_ascii_lowercase': use inherent methods instead
--> src/bits/charstr.rs:294:36
|
294 | .map(AsciiExt::to_ascii_lowercase))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated item 'std::ascii::AsciiExt::to_ascii_lowercase': use inherent methods instead
--> src/bits/charstr.rs:300:25
|
300 | self.iter().map(AsciiExt::to_ascii_lowercase)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated item 'std::ascii::AsciiExt::to_ascii_lowercase': use inherent methods instead
--> src/bits/charstr.rs:301:35
|
301 | .cmp(other.iter().map(AsciiExt::to_ascii_lowercase))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated item 'std::ascii::AsciiExt::to_ascii_lowercase': use inherent methods instead
--> src/bits/charstr.rs:310:25
|
310 | self.iter().map(AsciiExt::to_ascii_lowercase)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: `N` doesn't implement `std::fmt::Debug`
--> src/bits/record.rs:495:34
|
495 | #[derive(Clone, Copy, Debug, Eq, Fail, PartialEq)]
| ^^^^ `N` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
|
= help: the trait `std::fmt::Debug` is not implemented for `N`
= help: consider adding a `where N: std::fmt::Debug` bound
= note: required because of the requirements on the impl of `std::fmt::Debug` for `bits::record::RecordParseError<N, D>`
error[E0277]: `D` doesn't implement `std::fmt::Debug`
--> src/bits/record.rs:495:34
|
495 | #[derive(Clone, Copy, Debug, Eq, Fail, PartialEq)]
| ^^^^ `D` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
|
= help: the trait `std::fmt::Debug` is not implemented for `D`
= help: consider adding a `where D: std::fmt::Debug` bound
= note: required because of the requirements on the impl of `std::fmt::Debug` for `bits::record::RecordParseError<N, D>`
error[E0277]: `N` cannot be shared between threads safely
--> src/bits/record.rs:495:34
|
495 | #[derive(Clone, Copy, Debug, Eq, Fail, PartialEq)]
| ^^^^ `N` cannot be shared between threads safely
|
= help: within `bits::record::RecordParseError<N, D>`, the trait `std::marker::Sync` is not implemented for `N`
= help: consider adding a `where N: std::marker::Sync` bound
= note: required because it appears within the type `bits::record::RecordParseError<N, D>`
error[E0277]: `D` cannot be shared between threads safely
--> src/bits/record.rs:495:34
|
495 | #[derive(Clone, Copy, Debug, Eq, Fail, PartialEq)]
| ^^^^ `D` cannot be shared between threads safely
|
= help: within `bits::record::RecordParseError<N, D>`, the trait `std::marker::Sync` is not implemented for `D`
= help: consider adding a `where D: std::marker::Sync` bound
= note: required because it appears within the type `bits::record::RecordParseError<N, D>`
error[E0277]: `N` cannot be sent between threads safely
--> src/bits/record.rs:495:34
|
495 | #[derive(Clone, Copy, Debug, Eq, Fail, PartialEq)]
| ^^^^ `N` cannot be sent between threads safely
|
= help: within `bits::record::RecordParseError<N, D>`, the trait `std::marker::Send` is not implemented for `N`
= help: consider adding a `where N: std::marker::Send` bound
= note: required because it appears within the type `bits::record::RecordParseError<N, D>`
error[E0277]: `D` cannot be sent between threads safely
--> src/bits/record.rs:495:34
|
495 | #[derive(Clone, Copy, Debug, Eq, Fail, PartialEq)]
| ^^^^ `D` cannot be sent between threads safely
|
= help: within `bits::record::RecordParseError<N, D>`, the trait `std::marker::Send` is not implemented for `D`
= help: consider adding a `where D: std::marker::Send` bound
= note: required because it appears within the type `bits::record::RecordParseError<N, D>`
error: aborting due to 6 previous errors
For more information about this error, try `rustc --explain E0277`.
error: Could not compile `domain`.
When comparing domain names for deciding whether to compress the rest of the name or not, the case of ASCII letters in the name must be considered in order for the decompressed name to be identical to the original one.
Hint: use a Vec<u8>
as the key into the map, not a DNameBuf
. This may break for binary labels, but so what.
get list of windows adapters:
netsh interface show interface
Which will show the name under the "Interface Name" column (shown here in bold):
Enabled Connected Dedicated Ethernet
`
add dns server to an interface:
netsh interface ipv4 add dnsserver "Ethernet" address=192.168.x.x index=1
Help on using netsh int ipv4 set dns
`C:\Users\User>netsh int ipv4 set dns help
Usage: set dnsservers [name=] [source=]dhcp|static
[[address=]|none]
[[register=]none|primary|both]
[[validate=]yes|no]
Parameters:
Tag Value
name - The name or index of the interface.
source - One of the following values:
dhcp: Sets DHCP as the source for configuring DNS
servers for the specific interface.
static: Sets the source for configuring DNS servers
to local static configuration.
address - One of the following values:
: An IP address for a DNS server.
none: Clears the list of DNS servers.
register - One of the following values:
none: Disables Dynamic DNS registration.
primary: Register under the primary DNS suffix only.
both: Register under both the primary DNS suffix, as
well as under the connection-specific suffix.
validate - Specifies whether validation of the DNS server setting
will be performed. The value is yes by default.
Remarks: Sets DNS server configuration to either DHCP or static mode. Only
when source is 'static', is the 'addr' option also available for
configuring a static list of DNS server IP addresses for the
specified interface. If Validate switch is yes, then
the newly set DNS server is validated.
Examples:
set dnsservers name="Wired Ethernet Connection" source=dhcp
set dnsservers "Wired Ethernet Connection" static 10.0.0.1 primary
`
The scanner currently operates on u8
directly assuming ASCII-compatible encodings of master files. This may not be true on Windows.
Change the scanner to operate on char
, reading its data from a Iterator<Item=char>
.
I want to retrieve only MX
let mut core = Core::new().unwrap();
let resolv = Resolver::new(&core.handle());
let name = DNameBuf::from_str("www.rust-lang.org.").unwrap();
let mx_req = resolv.query((name, Rtype::Mx, Class::In));
let mx = core.run(mx_req).unwrap();
for record in mx.answer().unwrap() {
println!("{}", record.unwrap());
}
But the answer contains only CNAME.
Also, why does it require the dot in the end of a URL? Otherwise it panics at runtime.
Is there a way to query DNS records directly without futures?
Just want to directly look up the CNAME , A, AAAA, etc for a host so I can trace through them by hand. (working on a DNS mapping tool)
Errors are
error[E0432]: unresolved import `tokio_core::channel::Receiver`
--> /Users/zonyitoo/.cargo/registry/src/github.com-1ecc6299db9ec823/domain-0.1.0/src/resolv/request.rs:33:27
|
33 | use tokio_core::channel::{Receiver, Sender};
| ^^^^^^^^ Could not find `channel` in `tokio_core`
error[E0432]: unresolved import `tokio_core::channel::Sender`
--> /Users/zonyitoo/.cargo/registry/src/github.com-1ecc6299db9ec823/domain-0.1.0/src/resolv/request.rs:33:37
|
33 | use tokio_core::channel::{Receiver, Sender};
| ^^^^^^ Could not find `channel` in `tokio_core`
error[E0432]: unresolved import `tokio_core::channel::channel`
--> /Users/zonyitoo/.cargo/registry/src/github.com-1ecc6299db9ec823/domain-0.1.0/src/resolv/service/mod.rs:21:5
|
21 | use tokio_core::channel::channel;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Could not find `channel` in `tokio_core`
error: the type of this value must be known in this context
--> /Users/zonyitoo/.cargo/registry/src/github.com-1ecc6299db9ec823/domain-0.1.0/src/resolv/service/sequential.rs:72:61
|
72 | State::Reading(mut fut) => fut.take().map(|res| res.2),
| ^^^^^
error: the type of this value must be known in this context
--> /Users/zonyitoo/.cargo/registry/src/github.com-1ecc6299db9ec823/domain-0.1.0/src/resolv/service/sequential.rs:90:21
|
90 | request.set_id(rand::random());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: the type of this value must be known in this context
--> /Users/zonyitoo/.cargo/registry/src/github.com-1ecc6299db9ec823/domain-0.1.0/src/resolv/service/mod.rs:255:33
|
255 | State::Idle(receiver.into())
| ^^^^^^^^^^^^^^^
for linux: /etc/hosts
Hi,
I'm experimenting with domain
as a part of my effort to make generic/pluggable name resolution for tokio. It would be easier to play with the library if it was published on the crates.io.
So are there issues with that?
It should be with_capacity
, of course.
Compressed domain names can have infinite loops. The easiest way to avoid hanging on them is to add a counter and stop decompression at around 10,000 steps or so.
error[E0432]: unresolved import `tokio_core::channel::Receiver`
--> .cargo/registry/src/github.com-1ecc6299db9ec823/domain-0.1.0/src/resolv/request.rs:33:27
|
33 | use tokio_core::channel::{Receiver, Sender};
| ^^^^^^^^ Could not find `channel` in `tokio_core`
error[E0432]: unresolved import `tokio_core::channel::Sender`
--> .cargo/registry/src/github.com-1ecc6299db9ec823/domain-0.1.0/src/resolv/request.rs:33:37
|
33 | use tokio_core::channel::{Receiver, Sender};
| ^^^^^^ Could not find `channel` in `tokio_core`
error[E0432]: unresolved import `tokio_core::channel::channel`
--> .cargo/registry/src/github.com-1ecc6299db9ec823/domain-0.1.0/src/resolv/service/mod.rs:21:5
|
21 | use tokio_core::channel::channel;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Could not find `channel` in `tokio_core`
error: aborting due to 3 previous errors
error: Could not compile `domain`.
The tokio-core downloaded by cargo automatically is v0.1.6.
The environment i'm using is
4.8.0-41-generic #44~16.04.1-Ubuntu
cargo 0.19.0-nightly (c995e9eb5 2017-03-17)
The resolver configuration is currently read only from /etc/resolv.conf
which won’t work on Windows.
Since I don’t have access to a Windows machine, some help is necessary.
I have received some reports of crashes at https://github.com/partim/domain/blob/master/src/resolv/public.rs#L306
thread 'main' panicked at 'index out of bounds: the len is 2 but the index is 2', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/domain-0.2.1/src/resolv/public.rs:306
note: Run with `RUST_BACKTRACE=1` for a backtrace.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.