Monday, October 8, 2012

How to Use & Configure Google Public DNS on Linux System


When you use Google Public DNS, you are changing your DNS operator from your ISP to Google Public DNS.

In most cases, the IP addresses used by your ISP's domain name servers are automatically set by your ISP via the Dynamic Host Configuration Protocol (DHCP). To use Google Public DNS, you need to explicitly change the DNS settings in your operating system or device to use the Google Public DNS IP addresses. The procedure for changing your DNS settings varies according to operating system and version (Windows, Mac or Linux) or the device (computer, phone, or router).

Benefits and enhancements:
Performance: Many DNS service providers are not sufficiently provisioned to be able to support high-volume input/output and caching, and adequately balance load among their servers. In addition to load-balancing user traffic to ensure shared caching, Google Public DNS implements "smart" caching to increase the speed of responses. Google Public DNS independently resolves domain names and keeps the resolutions in the cache until their time-to-live (TTL) expires, at which point they are automatically refreshed. The cycle of caching and refreshing is performed offline, asynchronously with user requests, so that responses are almost always available directly from cache. 

Security: DNS is vulnerable to various kinds of spoofing attacks that can "poison" a nameserver's cache and route its users to malicious sites. The prevalence of DNS exploits means that providers have to frequently apply server updates and patches. In addition, open DNS resolvers are vulnerable to being used to launch denial-of-service (DoS) attacks on other systems. To defend against such attacks, Google has implemented several recommended solutions to help guarantee the authenticity of the responses it receives from other nameservers, and to ensure Google servers are not used for launching DoS attacks. These include adding entropy to requests, rate-limiting client traffic, and more. 

Correct results: Google Public DNS does its best to return the right answer to every query every time, in accordance with the DNS standards. Sometimes, in the case of a query for a mistyped or non-existent domain name, the right answer means no answer, or an error message stating the domain name could not be resolved. Google Public DNS never blocks, filters, or redirects users, unlike some open resolvers and ISPs.

Configuration:
Note: Before you change your DNS settings to use Google Public DNS, be sure to write down the current server addresses or settings on a piece of paper. It is very important that you keep these numbers for backup purposes, in case you need to revert to them at any time

The Google Public DNS IP addresses are as follows:
    8.8.8.8
    8.8.4.4
You can use either number as your primary or secondary DNS server. You can specify both numbers, but do not specify one number as both primary and secondary.

1) Edit /etc/resolv.conf:
sudo vi /etc/resolv.conf
2) Replace the nameserver lines with, or add, the following lines:
nameserver 8.8.8.8
nameserver 8.8.4.4
3) Save and exit.
4) Restart any Internet clients you are using.

Configuring DHCP client for dynamic ip address:
1) Edit /etc/dhclient.conf:
sudo vi /etc/dhclient.conf
2) If there is a line containing domain-name-servers, write down the IP addresses for future reference. Replace that line with, or add, the following line:
prepend domain-name-servers 8.8.8.8, 8.8.4.4;
2) Save and exit.
4) Restart your system.


Read more: http://linuxpoison.blogspot.com/2009/12/how-to-use-configure-google-public-dns.html#ixzz28hPhVv75