fn zone_result_helper(
name: &DomainName,
qtype: QueryType,
records: &HashMap<RecordType, Vec<ZoneRecord>>,
nsdname: &DomainName,
) -> ZoneResultExpand description
Handles the terminal cases of step 3 of the standard nameserver algorithm. If we’re here, we’ve got a domain and records which are associated with it. The possible cases are:
-
There are
NSrecord(s) delegating this name elsewhere, and the qtype is not exactly equal toNS. In which case we should return those. If this is a top-level non-recursive query they will be returned in the AUTHORITY section. -
There’s a
CNAMErecord on this name, and the qtype does not matchCNAME. In which case we return aCNAMEresponse, and the upstream resolver will then try go resolve that. -
Otherwise, return all RRs which match the query: this answers the question.