Crate dns

Expand description

DNS support for Rama.

§Hickory Dns

Hickory Dns is a Rust based DNS client, server, and resolver, built to be safe and secure from the ground up. It is the default (and only) dns provider for Rama.

By implementing the DnsResolver and optionally also using try_init_global_dns_resolver you can set however any kind of DnsResolver you wish.

More info about hickory dns can be found at https://github.com/hickory-dns/hickory-dns.

§Global DNS resolver

Rama uses by default a global and shared dns resolver. The default one for this is the Default HickoryDns value, which on unix and windows platforms is pulled from the system if possible, and as a fallback or on all other platforms the default cloudflare config is used.

Thank you cloudflare.

Use try_init_global_dns_resolver or init_global_dns_resolver to set the global DnsResolver as early as possible (e.g. at the top of your main function).

Use global_dns_resolver should you have a need for this global DnsResolver yourself.

The global dns resolver can be lazily fetched by making use of GlobalDnsResolver which allows you to create it only when actually using it. Great in case you need to have a DnsResolver value that you do not wish to do any work for, until you “really” need it.

§Rama

Crate used by the end-user rama crate and rama crate authors alike.

Learn more about rama:

Modules§

chain
hickory
dns using the [hickory_resolver] crate

Structs§

BoxDnsResolver
A boxed DnsResolver, to resolve dns, for where you require dynamic dispatch.
DenyAllDns
a DnsResolver implementation which denies all incoming DNS requests with a DnsDeniedError.
DnsDeniedError
Dns denied
DnsOverwrite
Wrapper struct that can be used to add dns overwrites to a service Context.
DomainNotMappedErr
domain not mapped in memory
GlobalDnsResolver
HickoryDns
DnsResolver using the [hickory_resolver] crate
InMemoryDns
in-memory Dns that can be used as a simplistic cache, or wrapped in DnsOverwrite to indicate dns overwrites.

Traits§

DnsResolver
A resolver of domains into IP addresses.

Functions§

global_dns_resolver
Get the global DnsResolver.
init_global_dns_resolver
Initialises the global DnsResolver.
try_init_global_dns_resolver
Tries to initialise the global DnsResolver.