It is possible to divert from the normal domain-name conversion supplied by your ISP, and instead specify your personal domain-name conversion. This is possible because before contacting the DNS, then the computer checks a special file named HOSTS whether it contains the domain-name and the corresponding IP-Address. The HOSTS file is a simple text file, which can be edited a text-editor like Notepad. The HOSTS file allows one to specify your own list of domains and their corresponding IP-Address.
The HOSTS file can be used to:
- Ban access to certain domains to avoid loading advertisements, thus making the Internet browsing quicker.
- Find the domain (The address from where the advertisement is loaded from)
- Insert the this dummy IP along with the domain in the file:
- If having problems creating the ban file it might help to have this line in the top of the HOSTS file:
- There is certain sites that provides pre-made HOSTS file for your convenience (and peril):
- Speedup DNS lookups by not needing to contact the DNS server, thus making the Internet browsing quicker.
- Find the IP for domain (Can be done by pinging the existing domain)
- Insert the discovered IP along with the domain in the file:
- There exists utilities to help you maintain your HOSTS files:
- Windows 9x = C:\Windows\
- Windows NT-2000 = C:\Winnt\System32\Drivers\etc\
- Windows XP = C:\Windows\System32\Drivers\etc\
- Linux/BSD/Solaris/Unixes = /etc/
- BEOS = /boot/beos/etc/
Note by default the HOSTS file only contains one active entry and that is "127.0.0.1 localhost". If having trouble with accessing a domain, then one can disable the HOSTS file effect by deleting or renaming the HOSTS file, and restart the browser(Sometime need to restart the system).
Note lately some hijackers have started to modify the HOSTS file to make redirects to a different site than intended. One can try to "lock" the HOSTS file by changing the file attributes to Read-Only, Hidden, System. If the file is placed on a NTFS partition then change the NTFS permissions for accessing the HOSTS file. Though if the hijacker is clever enough then it will have little trouble going around this "locking".
More Info MS KB972034 - Reset hosts file to default