Domain Name System fundamentals
DNS is a distributed naming system that associates domain names with network resources through a hierarchical zone structure managed by authoritative name servers.
Authoritative name servers store resource and zone information in records which can be queried by resolvers to identify and locate resources for routing network data.
Names are divided up into a hierarchy of zones which facilitates delegation. Separate name servers are responsible for a particular zone.
The root zone, which is simply . (a dot), contains records that delegate various top-level domains (TLDs) to other name servers. These types of records are called name server (NS) records and identify which DNS server is authoritative for a particular domain. It is not uncommon for there to be more than one NS record to indicate a primary and a backup name server for a domain.
Beneath the root zone are various TLD name servers that contain records for domains only within their TLD. These are address and canonical name records which are referred to as A and CNAME records.
For example, the .com name server contains a CNAME record for example.com, in addition to NS records that delegate zones to other name servers. The domain example.com might have its own name server so that it can then create other domains such as cloud.example.com.
Resolvers are often formed in two parts: a stub resolver which is usually a library on a user’s computer, and a recursive resolver that performs queries against name servers before returning the result to the user. When searching for a domain, the resolver starts at the end of the domain and works toward the beginning of the domain.
For example, when searching for cloud.example.com, the resolver starts with the root name server .. The root replies with the location of the .com name server. The resolver then contacts the .com name server to get the example.com name server. Finally, the resolver locates the cloud.example.com record and returns it to the user.
|
1 |
A user queries for the address of |
|
2 |
The recursive resolver queries the |
|
3 |
The record is not found, and the |
|
4 |
The resolver queries the |
|
5 |
The record is not found, and the |
|
6 |
The resolver queries the |
|
7 |
The |
|
8 |
The resolver forwards the A record for |
To make this search more efficient, the results are cached on the resolver, so after the first user has requested cloud.example.com, the resolver can quickly return the cached result for subsequent requests.