OpenDNS vs Google DNS
Services like OpenDNS and GoogleDNS can speed up your browsing experience while keeping you secure on the internet. Generally, when you are connecting to a website, your browser is using the domain name server (DNS) of your internet service provider (ISP). But your ISP probably doesn’t have the fastest DNS servers which might be slowing down your internet browsing.
The DNS servers translate domain names to IP addresses. Whenever you connect to the internet, the browser sends out a request with the domain name to the DNS server and gets back the numerical IP address. So when you put in a domain name like www.cnn.com, your browser asks the DNS server to find out the related IP address 51.101.193.67.
In order for a domain to be valid, it needs to be listed on at least one authoritative name server. There are different types of name servers spread throughout the internet. These name servers are helping the internet to function. For efficiency and performance reasons, the Domain Name System supports DNS cache servers. The job of the cache servers is to store DNS query requests for the time-to-live period. The time-to-live period is defined in the domain name record. It tells the cache to remember the specific domain name for a specific period of time. When the period is over, the cache has the right to forget or delete that record. These DNS server caches also use recursive algorithms to improve the efficiency of the queries.
The caching servers are considered resolvers. When you are using your local computer, you have the option to use your ISP’s resolver or define any other third-party resolver you want.
ISP Name Server Restrictions
Your ISP’s DNS servers are located near your location. So network routes are short which mean your response time from these DNS servers will be faster than third-party servers. However, ISPs often block certain DNS requests or they redirect traffic to warning pages for suspicious sites or torrent sites. This might feel like censorship. Third-party DNS server like Google Public DNS, OpenDNS, UltraDNS, DynGuide, and others can help you find ways around these restrictions.
DNS Server Options
Here are the IP address for the OpenDNS and GoogleDNS
Google DNS
Preferred: 8.8.8.8
Alternate: 8.8.4.4
OpenDNS
Preferred: 208.67.222.222
Alternate: 208.67.220.220
Testing the Speed of Resolution
On a Linux System, you can use the dig domainname.com and look at the ‘Query time’ to figure out the speed of the DNS server response. I tested for GoogleDNS, OpenDNS and 4.2.2.2 for querying google.com and linuxhint.com. Here are the results:
$ dig google.com @8.8.8.8 | grep 'Query time' ;; Query time: 55 msec $ dig google.com @208.67.222.222 | grep 'Query time' ;; Query time: 132 msec $ dig google.com @4.2.2.2 | grep 'Query time' ;; Query time: 307 msec ------- $ dig linuxhint.com @208.67.222.222 | grep 'Query time' ;; Query time: 108 msec $ dig linuxhint.com @8.8.8.8 | grep 'Query time' ;; Query time: 157 msec $ dig linuxhint.com @4.2.2.2 | grep 'Query time' ;; Query time: 254 msec
You can look at the query times and determine the best server for your location.
If you decide to use GoogleDNS as your primary and OpenDNS as your secondary DNS server, you can update the /etc/resolv.conf file to this:
nameserver 8.8.8.8 nameserver 208.67.222.222 nameserver 4.2.2.2
It’s important to remember that DNS servers will not change your internet speed. The speed will depend on your ISP. OpenDNS or GoogleDNS might provide a slight advantage in terms of name resolution and avoid known malware domains. This will help in situations where websites have multiple advertising images, scripts, etc. that need to quickly resolve multiple domain names.
DNS Flushing
Whenever you change your name server, it’s recommended that you flush the DNS cache. For Linux, you can restart the “nscd” or the “network manager”:
/etc/init.d/nscd restart Or service network-manager restart
Last Words
GoogleDNS and OpenDNS are free resources. So it’s worth your time to test these out to see if it can improve your web browsing experience.
