Weblog entry #1 for MrFusion

Slow Internet Access - Finally figured it out
Posted by MrFusion on Mon 10 Apr 2006 at 01:27
Tags: none.
So between three machines in my house, I have used Woody, Sarge and Etch. I would get them installed and set up, and everything would work fine and dandy for a little while, until after about a week.

Then, my apt-get would quit working, it would cease up trying to connect to my apt sources, resolving them as 1.0.0.0. I would not be able to connect to any instant messenger services (even though they worked fine before) and browsing websites would become unusually slow. When I'd boot into Windows, everything on the internet was quick and responsive. Whenever I would SSH into the machines, either remotely or locally, it would hang up for about 5-10 seconds while authenticating both my login name and password. It should be instantaneous. All three distros have done this to me.

Obviously, considering how it was resolving my apt sources to 1.0.0.0, there was something strange going on with the DNS. I Googled everything I could about internet being slow with Linux. Most people suggested disabling IPv6, which I tried, with no luck. I knew it wasn't just some strange bug in Debian since my work machines (all GNU/Linux) all accessed internet resources beautifully.

Here is a useful bit of information for any GNU/Linux user who uses an Actiontec (or similar) modem with DSL internet who is having similar issues: Actiontec modems don't seem to support the high-speed DNS resolution that Linux apparently does. I know little more about how DNS works beyond starting and configuring bind9, so I don't know exactly how to explain this phenomenon. Windows can get out just fine, but Linux seems to suffer a bit of slowdown.

So here is the trick to fixing it:

Don't use local DHCP or DNS servers. I'm behind a router as well as this modem, but these computers never leave my house so I prefer static addressing. It's faster and gives me more control (since I forward a lot of different ports to different machines). Use whatever local IP addresses your local DHCP service would assign, but use your ISP's DNS servers.

If you don't know how to obtain them, access your modem's configuration (your default gateway as a web URL) and check its connection status to determine what the primary and secondary DNS servers supplied by the ISP are.

Next, as root, place those into your /etc/resolv.conf file:

search
nameserver x.x.x.x
nameserver x.x.x.x

The first and second are primary and secondary DNS addresses, respectively. I also recommend using static addressing because this file won't get changed by DHCP (assuming DHCP affects this file, I've never checked to see).

Also, if you're using static addressing, make sure both nameservers are on the same line in your /etc/network/interfaces file:

dns-nameservers x.x.x.x x.x.x.x

Then do a networking service restart:

/etc/init.d/networking restart

Try it out. I can load websites instantly (thus discovering that Lynx isn't slow at all), all my IM software works, and I can do SSH logins instantaneously.

If that doesn't work, then try disabling IPv6, that seems to be a common solution for many people as well. :)

-MrFusion

 

User Login

Username:

Password:

[ Advanced Login ]

Register Account

Quick Site Search