Home | Projects | Notes > Computer Networks > Application Layer - Domain Name System (DNS)
The Domain Name System (DNS) is the hierarchical and distributed (or decentralized) naming system.
It is a group of name servers that resolves the domain names into IP addresses.
It is NOT a single server or single system or a single computer.
It follows the client/server model
When a host wants to access www.google.com
, it first looks up the local cache and sees if the corresponding IP address is there.
If so, www.google.com
will be resolved into the IP address and put into the IP packet so it can find its way to the google
server correctly.
If not, the host queries the DNS server which can resolve the internet name into IP address. When the host gets the IP address from the DNS server, it updates that information to the local cache for the future use. It then uses that IP address to access the google
server correctly.
Without DNS, the host cannot access to the destination without knowing the destination’s IP address.
Then why do we use the domain name (e.g., www.google.com
) instead of IP address (e.g., 8.8.8.8
)?
Domain name - meaningful strings easier for humans to remember (human friendly)
IP address - random sequence of numbers (router friendly)
Fully Qualified Domain Name (FQDN)
xxxxxxxxxx
51myhost . example.com .
2------ ----------- -
3host parent (trailing dot)
4name domain root server
5 name
The root server will be visited first in this example.
The 1st Level Domain is also referred to as the Top Level Domain.
Example of FQDN:
xxxxxxxxxx
91cs . uah . edu .
2-- --- --- ^
3 | | | root server
4 | | |
5 | | 1st level name server
6 | |
7 | 2nd level name server
8 |
93rd level name server
Each name server implements the zone information as a collection of resource records.
A resource record is a name-to-value binding (i.e., “host name” to “IP addresss” binding).
A resource record is a 5−tuple representation: <Name, Value, Type, Class, TTL>
Example (TTL
field ignored)
xxxxxxxxxx
1111. <edu, a4.nstld.com, NS, IN>
2 --
3 name server
4
52. <a3.nstld.com, 192.5.8.42, A, IN>
6 -
7 (IP) address
8
93. <ux01.cs.uah.edu, 128.111.143.187, A, IN>
10 --
11 Internet
Not all clients know about the root servers. A lot of servers are involved when in comes to DNS, and the main or top server in the DNS hierarchy is the root server.
DNS resolver is necessary for name resolution and it will be in the DNS client.
DNS client is a client machine configured to send name resolution queries to a DNS server.
DNS resolver will contact the root DNS server in order to get the IP address that is mapped to the name.
Resolving a name actually involves a client querying the local DNS server. We can have a DNS server in a local area network (LAN) and this helps alleviate traffic over the Internet because the name resolution can be done within the LAN.
Two types of DNS query technique:
DNS Recursive Query
Query beweeen the client and the local DNS server
DNS Iterative Query
Query beweeen the local DNS server and other name servers
First, the client checks the local DNS cache. If the name and the corresponding IP address are not there, it checks the hosts file which contains the mappings of IP addresses to host names. If still not there, it moves on with the following name resolution process:
The client queries the local DNS server. If it is not there,
The local DNS server queries the root server. (But, the root server does not know the complete detail.)
“Hey, do you know the IP address of klee.cs.uah.edu.
?”
The root server gives referral to the local DNS server to query the .edu server.
“No, I do not. But, I know the IP address of .edu server and it is 192.4.5.32."
The local DNS server queries the .edu server. (But, the .edu server still does not know the complete detail.)
“Hey, do you know the IP address of klee.cs.uah.edu.
?”
The .edu server gives referral to the local DNS server to query the uah server.
“No, I do not. But, I know the IP address of uah server and it is 128.112.129.15."
The local DNS server queries the uah server. (But, the uah server still does not know the complete detail)
“Hey, do you know the IP address of klee.cs.uah.edu.
?”
The uah server gives referral to the local DNS server to query the cs server.
“No, I do not. But, I know the IP address of cs server and it is 128.112.134.10."
The local DNS server queries the cs server. (But, the cs server still does not know the complete detail.)
“Hey, do you know the IP address of klee.cs.uah.edu.
?”
Now, the cs server will be aware of the klee server which is actually located in its local area network.
“Yes, I do! 128.112.144.154 is its IP address.”
The local DNS server will store this information in its local DNS cache and forward it to the client.
Once this is done, if any other clients want to reach klee.cs.uah.edu.
the name can be resolved by the local DNS server. Need not go through the DNS Iterative Query again!)
Finally, when the client receives the IP address from the local DNS server, it updates its own local cache for future reference.
To test before/after of this name resolution process in Windows OS, use ipconfig/displaydns
command in the command window. This command will show you the entries that are stored in the local DNS cache.
To check the hosts file on Windows OS, go to C:\Windows\System32\drivers\etc\
and open hosts
file. You can manually add the entries in that file by following the instruction written in that file.
Problem 1 Identify the correct order in which the following actions take place in an interaction between a web browser and a web server.
The web browser requests a web page using HTTP.
The web browser establishes a TCP connection with the web server.
The web server sends the requested web page using HTTP.
The web browser resolves the domain name using DNS.
Problem 2 If a server has no clue about where to find the address for a hostname then ___.
server asks to the root server
server asks to its adjacent server
request is not processed
none of the mentioned
Problem 3 The Protocol Data Unit (PDU) for the application layer in the Internet stack is ___.
Segment
Datagram
Message
Frame