When I’m surfing the Web using my “regular” Internet provider, everything typically goes as it should. I click on a link or type in a URL, and almost instantly, my web browser is loading the page I want. However, that isn’t always the case, and during the summer, when I’m using a shared connection, that most definitely is not the case. Using this Internet connection, I’ll click a link or type in a URL, but instead of loading quickly, I get a lot of “searching for host” or “looking for address” type messages.
What’s going on here? In some cases, I suppose, the Internet connection really is slow, but typically that’s not it, as evidenced by the speeds I get once the address has been “found” or when I’m downloading something. No, the real problem lies in the DNS servers being used.
What is DNS?
DNS stands for Domain Name Servers. Every web address has a numeric code called an IP address. It is this address that web browsers connect to (not the web address you typed into your URL bar). But web browsers need to “find out” what a website’s actual IP address is, which is where DNS servers come in. Let’s say you want to check out some baseball scores, so you type the following into your web browser:
Your web browser doesn’t know what that means (since it’s letters, and not a number-based IP address), so it queries a DNS server. The DNS server then looks up the IP address based on the URL you gave it, and sends it back to your web browser, which then connects to the actual IP address of the site. In this example, here is the IP address returned:
If you want, try that out and type the above IP address into your URL bar. You’ll be taken directly to espn.com, just as you would if you typed the “regular” web address.
In many cases, a slow connection isn’t really slow, but the DNS servers your connection is using are too busy to handle the load of queries they’re receiving, so they take a longer time than normal to respond, which makes the connection feel sluggish.
How to fix this? It’s simple, actually. Google, among other companies, has created DNS servers (the service is called Google Public DNS), made available, for free, to anyone who wants to use them. In Ubuntu Linux (and any other GNOME Linux distributions that use the Network Manager Applet), here’s how to get your connection to use Google’s Public DNS service.
Step 1 – Right-click on the Network Manager Applet in the panel. If you’re currently connected to the Internet, you should see a series of bars (like you’d see on a cell phone), indicating the strength of the signal. When you right-click, a menu will appear; you want the “Edit Connections…” option near the bottom.
Step 2 – Choose which connection you want to use Google’s service with. In my case, I’m adjusting my wireless connection, but you can choose from among the available options. Once you’ve clicked on the correct tab, choose the connection and click the Edit button.
Step 3 – A new window will appear with connection options. You want either IPv4 or IPv6, depending on what you’re using. In my case, it’s IPv4, so I click on that tab. By default my connection uses automatic DHCP, which configures everything according to my Internet Provider’s defaults, but I want to change the DNS servers, so I choose (from the Method menu), the option labeled “Automatic (DHCP) addresses only” which allows me to make some changes.
Step 4 – The text entry field for “DNS servers” is now able to be used, so I type in the IP addresses for the Google Public DNS service, as shown in the screenshot. They have two addresses available, so type them both in, with a comma separating them. You can use as many alternate DNS servers as you want, so if you use another service, such as OpenDNS, type them in as well. When you’re finished, click the Apply button and exit the Network Manager Applet preferences altogether.
Step 5 – You’ll now need to restart any program currently using your Internet connection (such as a web browser, RSS reader or email client), in order for it to use the new settings.
That’s it! When I first started using the shared connection I’m currently on, it was a huge pain. I’d click a web address and sometimes 5-6 seconds would go by before the actual page started loading. With Google Public DNS, however, that’s a thing of the past, and the connection feels as snappy as it should. So if you’re facing similar problems, don’t tear your hair out; choosing Google Public DNS could just save the day.