anchor.diff:    Answer = lists:last(MatchedRecords),
     case NSRecords = erldns_zone_cache:get_delegations(Answer#dns_rr.name) of
       [] ->
  -      resolve_exact_type_match(Message, Qname, Qtype, Host, CnameChain, MatchedRecords, Zone, _AuthorityRecords, NSRecords);
  +      resolve_exact_type_match(Message, Qname, Qtype, Host, CnameChain, MatchedRecords, Zone, _AuthorityRecords, NSRecords = []);
       _ ->
         NSRecord = lists:last(NSRecords),
         case erldns_zone_cache:get_authority(Qname) of
  
positive.code:   exact_match_resolution(Message, Qname, Qtype, Host, CnameChain, MatchedRecords, Zone, CnameRecords).
  
  %% No CNAME records found in the records with the Qname
  exact_match_resolution(Message, Qname, Qtype, Host, CnameChain, MatchedRecords, Zone, []) ->
    resolve_exact_match(Message, Qname, Qtype, Host, CnameChain, MatchedRecords, Zone);
  
  %% CNAME records found in the records for the Qname
  
negative.code: 
  %% There were no matches for exact name and type, so now we are looking for NS records
  %% in the exact name matches.
  resolve_exact_match(Message, _Qname, Qtype, Host, CnameChain, MatchedRecords, Zone, _ExactTypeMatches = [], AuthorityRecords) ->
    %lager:debug("No exact matches for name and type"),
    ReferralRecords = lists:filter(erldns_records:match_type(?DNS_TYPE_NS), MatchedRecords), % Query matched records for NS type
    resolve_no_exact_type_match(Message, Qtype, Host, CnameChain, [], Zone, MatchedRecords, ReferralRecords, AuthorityRecords);
  