I’ve been having a lot of problems with the DNS at my ISP. It regularly fails to resolve addresses, leaving me twiddling my thumbs. Is there any simple way of maintaining my own “mini DNS” of favourite websites and their IP addresses that I can get my browser to look up if the ISP’s DNS is down? (short of keeping a text file of IP addresses and manually entering them each time, that is)
Some of the various free web accelerator programs do this for you.
There’s a file in your C:\Windows directory called HOSTS.SAM. Open the file in Notepad and edit it to add the IP addressses you want to cache locally. One IP address per line followed by the name you want to resolve. Save the file and rename it to HOSTS (without the extention, be sure that Notepad doesn’t tack on a .txt for you. You might have to rename it by hand in Explorer to get rid of the extenstion). Once you restart it should work.
Note, don’t go crazy with the hosts file. If it gets too big, it can slow things down, since every resolution has to be checked. Also, if a website that you have in your HOSTS changes it’s IP address, your computer will still look for it the old one, so keep that in mind when troubleshooting problems.
yes…you want to create whats called a “host” file…HOW to make one depends on your OS…for Windoze, check http://www.microsoft.com/windows2000/library/resources/reskit/samplechapters/cnbb/cnbb_tcp_kqig.asp
"Host Name Resolution Using a Hosts File
One common way to resolve a host name to an IP address is to use a locally stored database file that contains IP-address-to-host-name mappings. On most UNIX systems, this file is /etc/hosts. On Windows 2000 systems, it is the Hosts file in the %SystemRoot%\system32\drivers\etc directory.
Following is an example of the contents of the Hosts file:
Table of IP addresses and host names
126.96.36.199 server1.central.slate.com s1
This maps the IP address of a site with the english URL…sort of bypassing your DNS server
BTW, I also use this to block a lot of the common banner ads (thus shortening the time that bannered web sites take to load)
see http://www.ecst.csuchico.edu/~atman/spam/adblock.shtml for how to do this
Thanks for the information on the files and utilities, everyone. I’ve started tinkering (carefully) with my hosts file, and I’ve also downloaded a web accelerator utility that scans my IE cache, looks up the DNS entries and makes a local copy.
another neat thing you can do with the hosts file is (almost) get rid of seeing ads.
find out the adserver’s address (done easily enough by moving the cursor over the banner ad, or right clicking on it and properties), and edit the hosts file to route that to local host, i.e.:
etc. i’ve got probably 200 different adservers in my file. i do get a few ads, but it’s pretty rare. all you see is an error page from IE when it searches for the ad in the banner box.
i know this works for IE, dunno about nutscrape or any other browsers.
ummm I think I mentioned that earlier in the thread
I’m going to have to try that adquery-redirect-to-localhost trick… so many times I’ve gone to a site, and it gets stuck on download, and I just know that it’s waiting for some bogged-down adserver…
It’s like the old story about the servants who were skimming from the master’s accounts. The master knew about the servants’ actions, but did not move to catch the servants, because he knew that he could then lean on them for the best service.
Likewise, if the ad companies are going to clog our pages with banners, they need for their own survival to be ultra-sensitive to ensuring that their servers can handle the loads requested of them. It won’t take much delay to start people finding ways to block or disable the adservers.
And that’s completely ignoring the privacy issues…
Some more thoughts. If you actually have an HTTP server running on localhost, you’ll get its default page in each adbanner if you try this trick. That might be interesting.
In a local network, it might be possible to set up a kind of null host, which would just throw away requests. I’m going to have to think about this…