0

I know that A,AAAA records will be cached by Recursive resolver and stub resolver. When a person searches a subdomain/domain, if it is CNAME record which is searched, the Resolver gets the corresponding domain name( because CNAME record value will also be domain ) and pass it to the client. Now does the Resolver repeat the entire search for finding the IP address for the domain name ( Root, TLD and authoritative nameserver) or since it has got the response from the Authoritative nameserver, will it be directly going to it, In that case can we say that the Authoritative nameserver will be cached and till how much time since we are not mentioning any TTL for NS record in our DNS Records?

1 Answers1

0

Recursive caching nameservers cache everything, and use the TTL to know when to redo a query.

we are not mentioning any TTL for NS record

Even if not mentioning them explicitly in your software/zonefile, ALL records have TTL, because this is a mandatory field in any response DNS message.

Do a dig query and you will see the TTLs.

Patrick Mevzek
  • 9,273
  • 7
  • 29
  • 42
  • Thanks @Patrick Got it, I see that NS will have TTL. I hope Recursive caching nameservers == Recursive resolver, Suppose I have searched for example.com nearly, so the Nameserver IP address is now stored in Resolver cache. So If I search admin.example.com, will it be going to that nameserver to that particular zone of example.com, In case it is a separate zone(child zone), it will go to the mentioned nameserver in NS record for admin and find the corresponding IP address. Is my assumption correct? – Allen Johnson Mar 15 '22 at 17:00
  • Things are simple. Nameserver does a query. It may need to recurse. So it learns about records, and store them locally with their TTL. For any other query, and any records it need, it looks inside its cache if it has the reply already and TTL has not expired if so it uses that data and goes to next step, if not, it does the query again. IF you resolve `example.com` for whatever type you obviously have to learn about `NS` records for that zone, so next time you don't need to query for those. See Appendix A of https://www.rfc-editor.org/rfc/rfc7816.txt for a typical full algorithm in resolution. – Patrick Mevzek Mar 15 '22 at 17:11
  • A recursive nameserver can work without a local cache. So all recursive nameservers are not necessarily caching ones, but certainly the vast majority for obvious performance reasons. All caching nameservers are most probably recursive ones, but lately with "CNAME at APEX" features and things like that even some authoritative nameservers may need to be recursive and will need a cache. – Patrick Mevzek Mar 15 '22 at 17:13