resolver
ModuleLooking a query up in a zone: exact names, wildcards, CNAMEs,
delegations and negative answers.
Contents
use utopia_dns::zone::resolver::lookup;Rust
pub fn lookup(query: &Message, zone: &Zone) -> Result<Message, Error>Answers query from zone, shuffling multi-record answers with a
generator seeded from the operating system.
See lookup_with.
use utopia_dns::zone::resolver::lookup_with;Rust
pub fn lookup_with(query: &Message, zone: &Zone, rng: &mut Mt19937) -> Result<Message, Error>Answers query from zone (the algorithm of
https://www.usenix.org/sites/default/files/styles/article_embedded/public/tree.png):
- no question:
FORMERR; - records named exactly like the question: the records of its type
(shuffled, RFC 2181 §5), else its
CNAMEs, else no data with theSOA; a name withNSrecords below the apex is a referral to them; - otherwise the closest enclosing wildcard's records, renamed to the question's name, chosen the same way;
- otherwise
NXDOMAINwith theSOA(anSOAquestion at the apex is answered with it).