Understanding DNS : Domain Naming Server

Hey folks, understanding DNS is key to troubleshoot so many problems in Active Directory world. So here we go, lets starts with... What is DNS? DNS stands for Domain Naming Server, it is a standard of naming domains in any operational environment (Windows,Linux,Solaris,Any environment). It is a server which contains a database of all the domains and all the servers which are associated with those domains.

Why it is Used?

Its a service dedicated  to identify all the machines (domains & member servers) in a network. To make this possible, every machine has to be registered in the authoritative DNS server of that network. That means every operational network should have a dedicated DNS server to enable identification and communication between the machines.

How it works?

As i said, it is dedicatedly used for identification, in technical words for “name resolution”. Every machine in a network has a dedicated IP address & hostname as its identity. Whenever a machine tries to communicate with another machine on the network it should first identify the second machine, that means it should know the ip address of that particular machine. After knowing the identity (i.e ip address), it will directly communicates with the second machine. So to speak, a machine should know the ip address of the another machine, with which its going to communicate before it starts. Another question… Why the hostnames are used, if the machine already have an identity in the terms of IP address? Hostname is an English word which is useful for Human remembrance. It is impossible for a human being to remember lots of  IP addresses, but it is possible to remember English names of the same hosts (as we configure the hostnames generally with employee name or department name or location name etc). For example we can remember www.yahoo.com but not its ip address, because we are not having only one website on the internet. To sum up Hostnames and IP addresses both are used to identification and communication between two machines in a network. But machines are only able to communicate with the IP addresses and which are impossible to remember for Humans (Keep in mind machines never communicate with hostnames). To solve this situation DNS was implemented. It basically contains a database of host records in a network. A host record contains “Hostname : IP address”, see the image below for better under standing. Out Internet is purely depended on DNS, when we access a particular website we will give its English name, when we press ENTER immediately the machines starts finding the IP address of the website using the DNS server configured on it. I will explain the name resolution process in details. And one more thing about the DNS is, it is the only largest database on the internet which changes every second. If this database goes down by a chance, we must remember all the ip addresses to access the internet. hahaha it will not happen, why because we have so many backup solutions already implemented.

How the name resolution takes place?

I will explain this concept with internet as an example. Before that i want you to check some settings on your machine. Check the TCP/IP properties and see whether DNS server is configured or not. If you are seeing obtain automatically option, open command prompt and type “ipconfig /all” and press Enter. You will get DNS servers information along with your machine’s IP address. Now lets talk about the scenario, When you try to open a website like www.google.com, what happens next? how your machine gets  IP address of the www.google.com. Here it goes….

1. The request sent to the DNS server which is configured on your machine.

2. The DNS server checks for the host record of www.google.com in its database, if it contains a record for www.google.com, it will directly send response with the IP address of www.google.com. Otherwise it starts requesting another DNS server.

3. Before it goes to another DNS server, how it identifies which DNS server is responsible for this request ? It checks the entire hostname (it is called as FQDN : Fully Qualified Domain Name), i.e in google’s case www.google.com. (note the FQDN ends with a period, and this period is called as root domain).

image4. Every DNS server contains a roothint file associated with it, and the same will be used to identify the responsible DNS server. Root hint file contains Master DNS servers information. Here you go it looks like this. These are the master DNS servers for .com, .net, .edu, .org domains etc.

5. So in your case, the domain is .com, DNS server sends request to .com master DNS server (for ex: assume it as 198.41.0.4), the .com master DNS server contains name server records for all machines ending with .com . That means it definitely contains DNS server IP address for google.com. In the same way it contains all .com servers yahoo.com, microsoft.com & so on.

6. It does not contain the IP address of google.com, it contains DNS server IP of google.com.

7. So then the request is forwarded to google.com DNS server, in that server you will have a host record with the name www and its IP address. Finally you reached it. With the found IP address the request comes back as a response in the same reverse way to the DNS server which is configured in your machine, that DNS server tells the IP address of www.google.com to your machine.

8. This process happens in milliseconds in the background. i.e by the time you will get “Website found waiting for reply” message in the status bar of your internet explorer.

9. Oh my god!!!! Is that simple? Yes it is. The same process occurs in corporate networks also. But the requests are handled by their local DNS servers only.

10. See the below animation for better understanding.

Thanks to author for making this video.

Thanks for you support, Keep visiting for more posts like these. Subscribe now. 

Comments

  1. King : Thank you for sharing. I really found all the topics are interesting and very detailed. We would understand Windows & VM by going through your websites and videos. Its worth and i feel you have discuss all the important topics.

    ReplyDelete
  2. Awesome.............very helpful

    ReplyDelete
  3. thank you so much its very helpful..

    ReplyDelete

Post a Comment

Popular posts from this blog

VMWare Interview Questions & Tips

Windows: 2012 Server: Restoration of server from ransomware brute force attack – Real time experience

Windows and VMware : System Admin Responsibilities