27 Jan

Which DNS resolver is good for you?

Which DNS resolver is better – ISP’s (default) DNS resolver, or Google Public DNS or the pioneer of DNS openDNS or even a local DNS server?

Let’s try to find out!

I am sitting on a BSNL data link, and I will try to perform few tests to find that out:

Available DNS resolvers to me:

  1. BSNL DNS resolvers – 218.248.255.194 & 218.248.255.196
  2. Google Public DNS – 8.8.8.8 & 8.8.4.4
  3. OpenDNS – 208.67.222.222 & 208.67.220.220
  4. Local DNS Server – BIND running on localhost – 127.0.0.1
Observing ping time:

 

BSNL DNS resolver:
— 218.248.255.194 ping statistics —
5 packets transmitted, 4 received, 20% packet loss, time 4001ms
rtt min/avg/max/mdev = 26.978/27.754/29.122/0.897 ms

— 218.248.255.194 ping statistics —5 packets transmitted, 4 received, 20% packet loss, time 4001msrtt min/avg/max/mdev = 26.978/27.754/29.122/0.897 ms

Google Public DNS:

— 8.8.8.8 ping statistics —

5 packets transmitted, 5 received, 0% packet loss, time 4001ms

rtt min/avg/max/mdev = 121.147/121.878/122.951/0.783 ms

OpenDNS:
— 208.67.222.222 ping statistics —
5 packets transmitted, 5 received, 0% packet loss, time 4005ms
rtt min/avg/max/mdev = 217.678/219.528/222.034/1.717 ms
Next, localhost? 🙂
Pinging local DNS server makes no sense as reply will be in less then 1ms!
Anyways, so here’s ping summary:
  1. BSNL – 28ms
  2. Google Public DNS – 122ms
  3. OpenDNS – 220ms
  4. Local DNS server – N/A

Next, we will try asking IP address of popular site facebook.com to all of these.

Here’s a sample query:

We can see, BSNL resolver passed the IP almost instantly for a popular site. Popular here simply means that resolver must be having the record within it’s cache as per TTL of the zone.

Observing resolution time:

Asking for IP of facebook.com to rest of DNS servers, here’s summary:

  1. BSNL resolver took 28ms
  2. Google Public DNS took  125ms
  3. OpenDNS took 219ms
  4. Localhost took 558ms

We see a very big value from local host here. Reason, it had to find the IP via root DNS servers. In my case, this local DNS resolver used – b.gtld-servers.net (closest) to get Authoritative DNS servers of “facebook.com” and next, it asked those DNS servers for the IP of facebook.com

Note: Further anymore queries to facebook.com using local DNS will take almost 0ms for next 1022 seconds as defined in DNS zone of facebook.

So for a popular site – clearly BSNL DNS resolver is winner based on responce which is 5 times faster then Google Public DNS and almost 10times faster then OpenDNS.

Next, we try to find how much time it takes to resolve a less popular domain – crazybeam.com

(less popular = no caching of records at resolver)

Time taken by all resolvers:
  1. BSNL took 223ms
  2. Google Public DNS took 398ms
  3. OpenDNS took 487ms
  4. Local DNS server took  667ms

As we can see – BSNL resolver took quite more time here but still very low. Local DNS resolver took almost same time to resolve a less popular domain as it took to resolve a popular domain – reasons remains – no caching.

So finally, here’s the summary explaining results and recommendation of which resolver to use:

  1. Google DNS is better then OpenDNS for India since OpenDNS has no mirrors in India. Closest mirror is Singapore, but actually most of data seems being routed from London. Here’s a traceroute for reference.
  2. Running a local DNS server is good if you have mid-size organization where you have atleast 1000+ users. This will help in building a decent DNS cache which will servce queries instantly apart from saving bandwidth used for DNS lookups.
  3. Local ISP DNS servers seems very good in initial testing based on very low latency values they give BUT remember – there’s a big problem associated with BSNL DNS resolvers – they do not store most of records till TTL is complete. That is – they perform very good for cached values as we can see, but they seem discarding cached records well before expiry of TTL. This makes them bit poor in performance as this does not happen with Google or openDNS at all. Hence for popular domains, Google takes ~120ms, while BSNL takes 220ms. OpenDNS remains bit slow for India.
  4. Apart from that, one of other big problems perticularly with BSNL DNS servers is – they constantly time out thus giving high packet loss, and causing “Name not found” errors.

 

So finally my recommendation – if you are on Indian ISP network, it’s good to use Google Public DNS.

3 thoughts on “Which DNS resolver is good for you?

  1. Wow.. great research…
    Good work buddy..

    I use ISP (BSNL) Primary DNS and using Secondary DNS as google can help when BSNL DNS delay.

    • That’s good idea Deepak.

      Although I found that BSNL’s DNS resolver constantly giving name not found for regular domain names. Secondary DNS resolvers come into picture ONLY when Primary “times out”. So if BSNL’s resolver’s give wrong answer, having Google on secondary won’t help much.

  2. Hey admin,
    u got nice research skill…..can u pls help me a bit???
    I have BSNL ISP, i use to play lot of online multiplayer games. for indian servers, bsnl gives fair ping times i.e. ~75ms but if i ping a server in pakistan, malasia or singapore etc which are inter continental countries, ping goes around 300ms which is very very bad for gaming. Point to be noted is pinging USA or UK servers gives ~250ms even when they are far from the continent. But sometimes for few hours, pings from mlasian servers are 140ms but again it changes to 300ms after few hours…what could be the reason???? can dns tactics help me?? i want low ping on asian servers..thanks

Leave a Reply