
194
|
Chapter 8, Desktop Programs
#61 Eliminate Annoying Browser Stalls
HACK
This tells your computer to check the DNS first, and if it cannot find the IP
address from the DNS, to try looking up the IP address in your local file
called /etc/hosts.
If the line looks more like the following, it checks the local file /etc/hosts
first, and then checks with a DNS if it can’t find the IP address from your
local file:
hosts: files DNS
In most cases, browsers are slow to load pages or stall on something such as
a graphical element, because the DNS is having trouble resolving the
domain name into an IP address.
Short-Circuit the DNS Request
You can short-circuit this process in a few steps. First, make sure the line in
your /etc/nsswitch.conf file looks like the latter example, where
files pre-
cedes
DNS. If your /etc/nsswitch.conf file places something other than files
first, rearrange the order to make sure files comes first.
Next, determine the domain name that is causing your browser to load a page
slowly or get stuck loading a web page element. Here’s how to track down the
troublesome site. Keep your eye on the status bar in your browser. If you are
experiencing the kind of problem I’ve been describing, the status bar usually
reads something like “Looking up www.someadvertisementsite.com” or “Wait-
ing for www.someadvertisementsite.com” while is it slow or stuck. The status
message won’t change until it can ...