Nerdrium Home



Web Design

Case Mods





My Blog




How to Set Up and Use a "hosts" File

Page 3

To make a hosts file, the first thing you need to do is find the IP addresses of the sites you *want* to be able to visit. I do this using a lookup function that does a "forward dns lookup" at namespace.

Once you have the IP address, you'll need to add the following things to your hosts file to make that website accessible. First, type the web address, for instance Then hit the tab key. Then type an "A" (for "allow", presumably). Tab again. Then type the IP address. Put each entry on a new line. Save the file as hosts.txt (the name really doesn't matter as long as you know what it is). It should look something like this:

Image of Hosts.txt file example

Note in that example the entry "" Here's where using a hosts file in place of DNS can be, well, a pain in the ass. Some websites host their images on a different server than their web pages. You need those IP addresses entered as well--otherwise the page will open with no images (and in our situation, usually not the games either). When you get to that page, you'll need to view the source code, and find out what servers the page is trying to find. Get the IP addresses for those servers, and put them in your hosts file as well. Sure, it ends up being tedious, but once it is taken care of you don't need to worry about having a 6-year-old accidentally come across a site that has gay porn, and then have to explain not only what sex is, but why men would do it with each other, and also why they would take pictures of it, and lastly why anyone would want to look at it on the internet. :)

Now you just need to let your TCP/IP control panel know that you want it to use your hosts file.

Previous [1] [2] [3] [4] Next