Trust-DNS 0.20.0 released with Tokio 1.0 support

Trust-DNS 0.20.0 has been released, and this release ended up being much bigger than initially anticipated. I wanted to thank @djc for stepping in to help with the project. In this release he has been a big support for bouncing ideas off of, refactoring a lot of older code, and helping move things along. It's been a huge help to me and the project. Thank you!

One neat thing to highlight in this release is the little resolve CLI tool for exercising the trust-dns-resolver. It's not full featured yet, but it will allow for many of the trust-dns-resolver features to be tested, overtime it will get more options to fully support the features of trust-dns-resolver. It's most akin to the Unix host command, but is not intended to ever be compatible with it. Over time I hope it to facilitate something between host and dig, we'll see where it ends up. It can be installed out of the trust-dns-util crate with:

$> cargo install trust-dns-util --bin resolve
$> resolve
Querying for A from udp:, tcp:, udp:, tcp:, udp:[2001:4860:4860::8888]:53, tcp:[2001:4860:4860::8888]:53, udp:[2001:4860:4860::8844]:53, tcp:[2001:4860:4860::8844]:53
Success for query name: type: A class: IN 21525 IN A

Help will describe all the current options:

$> resolve -h
resolve 0.20.0
A CLI interface for the trust-dns-resolver.

This utility directly uses the trust-dns-resolver to perform a lookup to a set of nameservers. Many of the features can
be directly tested via the FLAGS and OPTIONS. By default (like trust-dns-resolver) the configured nameservers are the
Google provided ones. The system configured ones can be used with the `--system` FLAG. Other nameservers, as many as
desired, can be configured directly with the `--nameserver` OPTION.

    resolve [FLAGS] [OPTIONS] <domainname>

        --cloudflare    Use cloudflare resolvers
        --debug         Enable debug and all logging
        --error         Enable error logging
        --google        Use google resolvers, default
    -e, --happy         Happy eye balls lookup, ipv4 and ipv6
    -h, --help          Prints help information
        --info          Enable info + warning + error logging
        --ipv4          Use ipv4 addresses only, default is both ipv4 and ipv6
        --ipv6          Use ipv6 addresses only, default is both ipv4 and ipv6
        --quad9         Use quad9 resolvers
    -s, --system        Use system configuration, e.g. /etc/resolv.conf, instead of defaults
        --tcp           Use only TCP, default to UDP and TCP
        --udp           Use only UDP, default to UDP and TCP
    -V, --version       Prints version information
        --warn          Enable warning + error logging

    -n, --nameserver <nameserver>...    Specify a nameserver to use, ip and port e.g. or
                                        [2001:4860:4860::8888]:53 (port required)
    -t, --type <ty>                     Type of query to issue, e.g. A, AAAA, NS, etc [default: A]

    <domainname>    Name to attempt to resolve, if followed by a '.' then it's a fully-qualified-domain-name

Thanks to everyone who's helped with this release, here are the changes for 0.20.0 (apparently only 10 users can be mentioned in a post, so removing direct links to user names, lame):



  • (all) upgraded to Tokio 1.0 (@messense) #1330 (0.3 updates in #1262)
  • (proto) Add serde support for the RecordType in the proto crate (LEXUGE) #1319
  • (https) dns_hostname args all are Arc<str> rather than Arc<String>, use Arc::from
  • (proto) Set TCP_NODELAY when building a TCP connection (djc) #1249
  • (all) BREAKING The UdpSocket trait has grown an associated Time type.
  • (all) BREAKING The Connect trait has lost its Transport associated type, instead relying on the Self type.
  • (all) BREAKING Introduced a new DnsTcpStream trait, which is now a bound for implementing the Connect trait.
  • (resolver) BREAKING Move CachingClient from lookup_state to caching_client module
  • (resolver) BREAKING Move ResolverOpts::distrust_nx_responses to NameServerConfig::trust_nx_responses (djc) #1212
  • (proto) data-encoding is now a required dependency #1208
  • (all) minimum rustc version now 1.45
  • (resolver) For all NxDomain and NoError/NoData responses, ResolveErrorKind::NoRecordsFound will be returned #1197
  • (server) Support for lowercase DNSClass and RecordType fields in zonefiles (zhanif3) #1186
  • (resolver) Make EDNS optional for resolvers (CtrlZvi) #1173
  • (all) Fully support ring for all DNSSEC operations. #1145
  • (all) No more master (branch, moved to main) and slave, in honor of Juneteenth #1141
  • (all) Minimize futures dependencies (JohnTitor) #1109
  • (proto) increases the UDP buffer size from 2048 to 4096 to allow larger payloads (DevQps) #1096
  • (resolver) use IntoName trait on synchronous resolver interface (krisztian-kovacs) #1095
  • (resolver) BREAKING removed async for AsyncResolver::new (balboah) #1077 #1056
  • (server) BREAKING removed Runtime from ServerFuture::register_socket (LucioFranco) #1088 #1087
  • (proto) Breaking Adjust the return value from ResponseCode::high from u16 to u8 #1202


  • (client) Support reading the root hints file (mattias-p) #1261
  • (resolver) Fix Glue records resolving (wavenator) #1188
  • (resolver) Only fall back on TCP if cons are available (lukaspustina) #1181
  • (proto) fix empty option at end of edns (jonasbb) #1143, #744
  • (resolver) Return REFUSED instead of NXDOMAIN when server is not an authority (AnIrishDuck) #1137
  • (resolver) forwarder: return NXDomain on e.is_nx_domain() (balboah) #1123
  • (resolver) Regards NXDomain and NoError empty responses as errors (continues searching for records), #1086 #933


  • (util) new Add as CLI for trust-dns-resolver #1208
  • (proto) Added proper zone display to all RData as an impl of Display #1208
  • (proto) xfer::dns_response::NegativeType and DnsResponse::negative_type to classify negative response type #1197
  • (proto) DnsResponse::contains_answer to determine if a response message has data related to the query #1197
  • (proto) RecordType::is_soa and RecordType::is_ns to easily check for these types #1197
  • (proto) Message::all_sections to allow iteration over all Records in all sections in a Message #1197
  • (proto) Message::take_queries to remove from a Message without requiring clone #1197
  • (proto) DnsHandle::Error associated type to support generic errors across trust-dns libraries #1197
  • (resolver) Add support for tlsa RRs in trust_dns_resolver (smutt) #1189
  • (resolver) Support pointer ending label compression (jacoblin1994) #1182
  • (proto) Keep OS error information on io::Error (brunowonka) #1163
  • (proto) Support mDNS cache-flush bit (fluxxu) #1144
  • (proto) Allow creating TXT Rdata with binary data (bltavares) #1125
  • (proto) Add mutable access to Message fields (leshow) #1118
  • (proto) Add Name.parse_ptr_name, to IP address (Mygod) #1107
  • (resolver) Allow HTTPS to be generic over Runtime (balboah) #1077 #1074

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.