Setup Google DNS under Linux


So a few months back the owner of this blog asked me to make a Windows app for him that would auto-setup Google DNS with just a click of a button, and I did, and after trying it out on my machine, I noticed a bit of a speed difference, and I loved it, however, I have since moved back to Linux, and I have re-discovered how to set up Google DNS in Linux (namely *buntu).  So I thought that I would share.

First of all, lets give a simple explanation for what DNS is for those that have no idea.

From Google’s own site (and I love this explanation)

The DNS protocol is an important part of the web’s infrastructure, serving as the Internet’s phone book: every time you visit a website, your computer performs a DNS lookup. Complex pages often require multiple DNS lookups before they start loading, so your computer may be performing hundreds of lookups a day.

Ok, so yeah, there we go, it is where your internet goes to get the IP numbers that actually run the internet, that is associated with website names, say google.com, or even therightguy.info.

Ok, so, start up a console/terminal, and type (or paste) this.

 sudo nano /etc/resolv.conf

when nano starts up it may have an entry like this in it.

nameserver 127.0.0.1

This is fine.  We want to go to the end of this number, press enter, and type this

nameserver 8.8.8.8

press enter so that it goes to a new line, and type in this…

nameserver 8.8.4.4

Now we save the file (press Control + O), it will ask the save file name, just press enter, then press Control + X.  This exits nano.

From here on out you may want to reboot, and after you do so, open up a terminal/console again, and type…

host google.com

The  output should look something like this.

google.com has address 72.14.207.99 
google.com has address 64.233.187.99 
google.com has address 64.233.167.99 
google.com mail is handled by 10 smtp4.google.com. 
google.com mail is handled by 10 smtp1.google.com. 
google.com mail is handled by 10 smtp2.google.com. 
google.com mail is handled by 10 smtp3.google.com.

If it does, then you are good, enjoy the new speed boost!

If you want to undo this, simple do the first command up top, but remove the two new lines that we added, saved the file, exit, and reboot. Voila! Back to normal!

 

, , , , , , , , , , , , , , ,

  1. No comments yet.

You must be logged in to post a comment.

  1. No trackbacks yet.
%d bloggers like this: