domain 0.2.4

A DNS library for Rust.


A DNS library for Rust.

Travis Build Status AppVeyor Build Status Current



First, add this to your Cargo.toml:

domain = "0.2"

Then, add this to your crate root:

extern crate domain;

Note: The resolver that is part of this crate only does DNS lookups. If you want to perform lookups according to the system’s configuration, including things such as looking at the local hosts file, consider using the netdb crate instead.

Features (aka TODO)

Eventually, this crate will provide the following functions:

  • DNS data handling

    • Basic types.

    • Implementations for all IANA-registered record types.

    • Wire-format parsing and constructing.

    • Master format parsing and constructing.

  • Stub resolver.

    • Asynchronous stub resolver based on futures and tokio.

    • Rich set of DNS tasks:

      • querying for raw DNS records,

      • querying for host names,

      • reverse host name queries,

      • querying for mail servers (MX records),

      • querying for server addresses based on SRV,

      • verification of server certificates based on TLSA,

      • verification of PGP keys based on OPENPGPKEY,

      • verification of S/MIME certificates based on SMIMEA,

    • EDNS support.

    • DNSSEC verification of records.

    • DTLS- and TLS-secured connections to upstream resolver.

  • Recursive resolver (details TBD).

  • Authoritative name server (details TBD).

The idea for both the recursive resolver and the authoritative name server currently is to supply libraries that allow including this functionality in programs instead of building general purpose products. We may split the four top-level points into separate crates along the way.


The stub resolver currently is of limited use under Windows since I have no idea what the correct way to determine the system’s resolver configuration is. I would be very grateful for a hint as to that, so the crate becomes properly cross platform.


If you have comments, proposed changes, or would like to contribute, please open an issue.


domain is distributed under the terms of the MIT license. See LICENSE for details.