The Domain Name System (DNS) is a hierarchical and decentralized naming system for computers, services, or other resources connected to the Internet or a private network. It associates various information with domain names assigned to each of the participating entities. Most prominently, it translates more readily memorized domain names to the numerical IP addresses needed for locating and identifying computer services and devices with the underlying network protocols.
Services Provided by DNS
DNS is commonly employed by other application-layer protocols—including HTTP, SMTP, and FTP—to translate user-supplied hostnames to IP addresses. As an example, consider what happens when a browser (that is, an HTTP client), running on some user’s host, requests the URL https://www.ntu.edu.sg/Pages/home.aspx. In order for the user’s host to be able to send an HTTP request message to the Web server www.ntu.edu.sg, the user’s host must first obtain the IP address of www.ntu.edu.sg. This is done as follows.
- The same user machine runs the client side of the DNS application.
- The browser extracts the hostname, www.ntu.edu.sg, from the URL and passes the hostname to the client side of the DNS application.
- The DNS client sends a query containing the hostname to a DNS server.
- The DNS client eventually receives a reply, which includes the IP address for the hostname.
- Once the browser receives the IP address from DNS, it can initiate a TCP connection to the HTTP server process located at port 80 at that IP address.
Hierarchy of DNS servers
there are three classes of DNS servers—root DNS servers, top-level domain (TLD) DNS servers, and authoritative DNS servers—organized in a hierarchy as shown in Figure.
Root DNS servers. In the Internet there are 13 root DNS servers, most of which are located in North America. Although we have referred to each of the 13 root DNS servers as if it were a single server, each “server” is actually a cluster of replicated servers, for both security and reliability purposes.
Top-level domain (TLD) servers. These servers are responsible for top-level domains such as com, org, net, edu, and gov, and all of the country top-level domains such as uk, fr, ca, and jp.
Authoritative DNS servers. Every organization with publicly accessible hosts (such as Web servers and mail servers) on the Internet must provide publicly accessible DNS records that map the names of those hosts to IP addresses. An organization’s authoritative DNS server houses these DNS records.
Interaction of the various DNS servers
Suppose the host univ.edu.sg desires the IP address of ntu.edu.sg Also suppose that University’s local DNS server is called dns.univ.edu.sg and that an authoritative DNS server for ntu.edu.sg is called dns.ntu.edu.sg As shown in Figure, the host univ.edu.sg first sends a DNS query message to its local DNS server, dns.univ.edu.sg. The query message contains the hostname to be translated, namely, ntu.edu.sg The local DNS server forwards the query message to a root DNS server. The root DNS server takes note of the sg suffix and returns to the local DNS server a list of IP addresses for TLD servers responsible for sg. The local DNS server then resends the query message to one of these TLD servers. The TLD server takes note of the ntu.edu.sg suffix and responds with the IP address of the authoritative DNS server for the University of Nanyang Technological University, namely, dns.ntu.edu.sg. Finally, the local DNS server resends the query message directly to dns.ntu.edu.sg, which responds with the IP address of ntu.edu.sg.
Recursive queries in DNS
The queries of a host on a local domain name server will generally use recursive query. So-called recursive query is: if the host asked by the local domain name server does not know the IP address of the domain name was found out, then the local domain name server in the DNS client’s identity, send a query request message to other root name servers to continue (instead of the host to query), instead of the host himself on to the next step of the query. Therefore, the recursive query returns either the IP address being queried or an error indicating that the desired IP cannot be found.
DNS record caching
In both cases, we know that either recursive or iterative queries send packets of eight UDP user datagrams. In order to improve the efficiency of DNS query, reduce the load of root DNS server and the query quantity of DNS datagram, cache is widely used in DNS. The cache is used to hold records of recently queried domain names and where domain name mapping information was obtained.
Suppose we want to query the IP address of the domain name www.google.com/. If the local domain name server has the IP address of the domain name, we can directly get the corresponding IP address from the local domain name server, instead of going to the root domain name server to query.When the local DNS server cannot find the IP address, the local DNS server can also send the request message directly to the top-level DNS server instead of the root DNS server.