DNS recursion is a common topic for our telecommunication clients. We were looking for something basic to outline the steps that take place to get your client application to connect with the host name you are trying to access.
There’s a little more to DNS recursion than this, but this map does a fairly good job of detailing the process.
- The color-coding is meant to help identify which server is “asking” and what server is providing the response. The steps are as follows:
Client computer tries to resolve http://google.com the request is sent to the Preferred DNS Server, in most scenarios this will be what your ISP provided to you.
- The Preferred DNS Server will actually handle most of the workload in this case(hence the recursion). The Preferred DNS Server will first check to see if it is the Authoritative Host for the Zone google.com(as in, if it hosts the zone google.com); if it is, then it sends the client computer back the IP address for the host record needed.If the Preferred DNS Server is not Authoritative for the zone in question, and if it has DNS Caching enabled, it will check its Cache to see if it has recently resolved that hostname, and if so, it will send the IP address in its cache back to the client. Cached records have a TTL and when this TTL expires, the Preferred DNS Server will in fact go through with the DNS recursion process; which will cause that record to be updated again. (See DNS Propagation)Cached records alleviate the load by skipping the need to resolve a host name for every single request.If the
- Preferred DNS Server does not have a cached record for the request, or the cached record has expired, it will then send a request to the Root DNS servers.
- The Root DNS server will then respond to the Preferred DNS Server with an address for the Top Level Domain containing the next bit of information needed for this process; .COM was not the easiest to use in this example but TLDs are organized by Country Codes (.CA,.BM,.UK), Generic (.COM, .NET, .ORG) and Sponsored (.travel, .info).
- Once the Preferred DNS Server has the TLD’s address, it will request from the TLD the the actual Name Server records for the zone. The Name Servers are the ones hosting the actual DNS Zone for google.com
- Once the Preferred DNS Server has the NS address back from the TLD, it can query the actual Primary NS (there are usually more than one NS returned) for the record needed, in this case the Address record for google.com
- The Preferred DNS Server will then refresh it’s DNS cache (if it has caching enabled) as well as provide the client with the IP address associated with google.com
- To the client application this is transparent, the client application would simple proceed with whatever requests it is trying to perform on that host, but now that the IP address is resolved, the data/requests would route to the appropriate host.