In the previous two parts, I explained why you may want to configure your DNS to another service besides what your ISP provides you, and how to configure it in Windows. This post will explain how to configure your DNS on linux—using a GUI and a Command Line. And finally, it will explain how to configure your DNS on Mac OS X.
In Linux, your DNS settings are stored in a file called resolv.conf, which is located in the /etc folder. If you’re using a desktop such as Gnome or KDE, then you need to edit this file as root or sudo. The easiest method that I found in KDE was to open a Terminal, and type in “sudo kate /etc/resolv.conf”. When I did this in my VM, I received a few error messages in Terminal, but Kate opened up with the resolv.conf file loaded.
If you wish to do this via the command line, you simply enter “sudo vi /etc/resolv.conf” or “sudo emacs /etc/resolv.conf” (depending on your editor preference). After being prompted for your password, it will open with resolv.conf loaded.
Once you have resolv.conf open, you may see something similar to the following:
or you may not have anything in the file at all. It’s recommended that you write down any IP addresses listed in the file, and then edit them to the IP addresses for the Public DNS service that you wish to use.
After doing so, either Save the file (if in Kate), or use :w to write the file in vi (or the comparable method in Emacs or whatever your editor is).
Next, you’ll close your Internet clients (browsers, twitter apps, e-mail, etc) and restart them.
Mac OS X (10.5 and maybe later—I don’t have access to this, so I can’t confirm)
1. Click on the Apple Menu, then click on System Preferences, and finally click on Network. You may be prompted for an Administrator password.
2. Select the connection that you wish to configure, and click Advanced.
3. Select the DNS tab.
4. Click the +. Either replace the DNS addresses with your Public DNS addresses, or add them to the top of the list (first listed has priority).
5. Click Apply and OK.
**** Note that these instructions were taken almost verbatim from the “Using Google Public DNS” instructions located at http://code.google.com/speed/public-dns/docs/using.html.
Routers and Modems:
Typically your router will be located on 192.168.x.1 or 192.168.x.254 (where x represents a number such as 0 or 1). You should consult the documentation for your router, or you can find instructions on accessing your router at http://www.portforward.com. If you use PortForward, simply choose any application to get into the instructions for setting up your router (as they don’t have instructions for a Public DNS, and you only need help getting into the router).
You will be prompted for your Administrator password. If you haven’t changed it at all, then it will be the default password (supplied in your documentation or possibly listed on portforward). *****You really should change this password, while you’re in the router configuring your DNS.
Find the screen where you can change your DNS entries (on Linksys routers, it’s probably located on Setup—but this will vary).
If there are already IP addresses listed, then copy them down as backups. Then replace them with the IP addresses for the Public DNS that you wish to use.
Save and exit (possibly will be “Save and Restart”).
Restart your browser.
Testing the new DNS entries:
Google recommends testing the new settings by navigating to a site, and then adding it to your bookmarks (if it opens). Then try navigating to the site through the bookmark. If it opens both ways, then you’re good to go.
If not, then try navigating to an IP address (they recommend http://184.108.40.206 which points to http://eecs.mit.edu) and bookmark that page. If you can navigate back to the bookmark, but not through the site name, then you have an issue with your DNS entries.
If these tests don’t work, roll back your DNS settings (which is why you copied them down) and try again. If the tests still fail, then you have network issues—and probably should contact your ISP for help.
Have a great day:)