You have a host file found at C:\Windows\system32\drivers\etc\hosts that allows you to specify IP addresses and their mappings to a URL. For instance, when you type in http://www.reuters.com or something similar - you are actually going to an IP address (126.96.36.199) that is mapped using a DNS server somewhere. Sometimes you are not going to want to do the DNS lookup, but instead use a specific and known IP address when a URL is typed in within your browser or if your application is using URLs to surf the Internet.
Opening the host file in Notepad, you can make these mappings yourself. By default you will find the following in the file:
# Copyright (c) 1993-1999 Microsoft Corp.
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
# For example:
# 188.8.131.52 rhino.acme.com # source server
# 184.108.40.206 x.acme.com # x client host
This shows only one entry - localhost. This means that when you type http://localhost/whatever you will actually be routed to 127.0.0.1 (which is the IP address of your local machine without leaving the machine). One nice trick is that you can change this to something like the following:
Now instead of typing in http://localhost ... you can now use http://m. Also, getting the IP addresses of sites you frequently type in, you can do something like the following:
220.127.116.11 s # slashdot.org
18.104.22.168 g # google.com
Here, typing in 's' will take you straight to Slashdot.org (the pound or hash symbol signifies comments). Typing in 'g' will take you to Google.com. Probably one of the coolest features you can accomplish with this host file is that you can route all requests to advertisements on a page to your local machine. This means that instead of your computer making a request to get the ad (usually a .gif or .jpg image) you computer will simply route the request to the local machine (thereby really never making the request). This will improve your browsing performance. So, for instance, take a look at the following:
So when a page is instructed to make a request to adserver-2.ig.com.br for the advertisement, you computer will instead make the request to the local machine - thereby not producing the ad on your computer. Obviously this would be a lot of work to compile a list of advertisement URLs - but you can find a complete list to put in your host file at http://someonewhocares.org/hosts/. This works on most Windows machines, including Vista. Enjoy a better surfing experience!