What exactly is DNS?
DNS stands for Domain Name System. It is responsible for converting for domain names like google.com into IP address – 126.96.36.199. So you can visit the website on URL http://google.com then using a hard to remember IP address like http://188.8.131.52
How exactly DNS works?
For working, DNS relies on the core part – the root DNS servers also known as gTLD (Generic Top Level Domain) servers which hold the data for all popular extensions like .com/.net/.org etc, apart from that, there are root servers for ccTLD’s for Country Code Top Level Domains like .in, .us, .co.uk etc. These DNS servers just hold the data about the responsible DNS servers for a particular domain. E.g in case of “google.com” the root servers which hold data of all .com domain names, know that DNS servers responsible for google.com are ns1.google.com, ns2.google.com, ns3.google.com and ns4.google.com with their IP addresses. These servers actually hold the name to IP mapping of google.com. That is, there exists an A record (stands for address record) for google.com to the respective IP addresses.
How do you reach these root DNS servers?
This is where ISP comes in. To make things super simple – most of ISP’s use so-called DHCP – Dynamic Host Control Protocol – which is used for allocating certain things like IP address, subnet mask, default gateway and the DNS resolver addresses automatically whenever you connect to ISP. So, you actually use DNS via ISP’s DNS resolvers.
What exactly are DNS resolvers?
DNS resolvers are simply the part of Domain Name System which are responsible for resolving a perticular domain name. E.g take an example – you want to open http://mail.google.com on your BSNL broadband connection. Here, your system will ask DNS resolver of ISP i.e BSNL – for the IP address of mail.google.com – next it will wait for the reply.
DNS resolver – upon receiving a “DNS query” will try to look into its cache to see if it knows IP address for mail.google.com – assuming you opened for the first time – it will not find IP in cache. Next, it will look into the right most part to find what is the first level domain associated with that hostname – which is .com in case of mail.google.com
Now, BSNL DNS resolver holds the IP address of all gTLD root servers, and it will go to the nearest one and will ask for the next part – “google.com”. Here root server will pass a non-authoritative reply telling it ns1,ns2,ns3 and ns4.google.com are responsible for the DNS zone of “google.com”.
So next, DNS resolver of BSNL will go any one of those (depending on nearest and efficient route) and will ask for “mail.google.com” IP address, which will be provided by the authoritative DNS servers of Google along with a TTL. Next, DNS resolver of BSNL will pass you the IP address of mail.google.com.
What exactly are TTL and DNS caching means?
TTL means Time To Live. It makes system more efficient by caching off the DNS records. When you ask for IP address of mail.google.com to BSNL’s DNS resolver, once it resolves the hostname by querying root DNS servers, and further the Google’s DNS server – it caches that record. DNS resolver keeps the record in the cache based on the time mentioned in TTL (in seconds).
So if mail.google.com has a TTL value of 3600 – it means DNS resolver can keep this hostname to IP mapping for 1hr period. Based on the standard, DNS resolver is permitted to discard these packets before completion of TTL, but under no condition they are permitted to keep these records for more time then mentioned in TTL.
So what exactly is a problem with DNS for Indian users?
Problem is with DNS resolvers. Most of ISP’s DNS resolvers are not really optimised and perform poor during peek load. They are not optimised to keep all records in cache and thus, they keep on dropping cache data well beyond the expiry of TTL, apart from that – most of DNS resolver become non-responsive during peak load which gives – “name not found” error, even when you are connected to Internet.
So, what’s the way out?
Way out to this problem is – using other available DNS servers. Google recently started offering Free Public DNS resolvers to users across the world, which perform a lot better then compared to ISP’s DNS resolvers. The other popular option is OpenDNS. Based on my tests, I found OpenDNS is not very good way to issue since they don’t have any server located in India, and they route all traffic via London or Singapore location – which increases latency significantly.
So which one is best DNS resolver for me?
I highly recommend using open source tool called Namebench which checks all available DNS resolvers to you, and find which is best in terms of performance by sending them over few thousand queries.
I personally prefer using Google DNS over OpenDNS because Google DNS replies in less time, apart from no crazy DNS redirection for none-existing domain names as what OpenDNS does – making situation little frustrating.
After you choose which DNS resolver to choose, you can change DNS servers in Windows as:
1. Click on the connection link near the bottom of the screen.
2. Click on “Properties.”
3. Under “General Properties” tab – select Internet Protocol (IPv4) and click “Properties”.
4. Next, in the lower part of the screen select the radio button – “Use following DNS server addresses:”
5. Next Enter the two DNS resolvers. In case you use namebench, it will provide you with IP address of prefered servers, else you can use 184.108.40.206 & 220.127.116.11 for Google Public DNS, while 18.104.22.168 & 22.214.171.124 for openDNS.
Hope this will help you to fix DNS resolver issues and eventually a better experience on Internet!
Anurag is a Student and a part time network admin at dito.
He is all around network related technologies like DNS, Internet routing, servers, connectivity etc. He is also one of Power Posters at Official Google Apps forum and is involved in deployment of Google Apps.
Anurag is doing bachelors in Information & Technology from a State college in Haryana.