Jimmy's Blog Jimmy Ruska's Blog
Spoof domains with the hosts file Posted on Wednesday, February 13 2008
Roleplay. Learn to play songs by ear! Free Ear Training.
[Video Tutorial] How to build google chrome extensions

The changes you make will obviously not affect anyone else, but you can change any domain to point to wherever you want using the hosts file. eg. make google.com point to your homepage, or make http://a/ go to your localhost. In fact, the hosts file is where "localhost" is defined. You can make modifications for pranks, convenience, or even spam blocking.

This works on most operating systems. Here's the corresponding locations.

  • Windows NT/2000/XP/Vista: %SystemRoot%system32driversetc is the default location, which may be changed.
  • Windows 95/98/Me: %WinDir%
  • Linux and other Unix-like operating systems: /etc
  • Mac OS 9 and earlier: System Folder: Preferences or System folder (format of the file may vary from Windows and Linux counterparts)
  • Mac OS X: /private/etc (uses BSD-style Hosts file)
The basic format is

IP domain
Example

127.0.0.1 www.google.com

This word make the domain www.google.com redirect to your local ip. To edit it, just drag it into a text editor. If you have apache running, you could make a fake hacked by you page to fool your friends. Redirecting a spam pack to an invalid IP is also a good idea. You could also use it to redirect myspace to an educational page if you're a controlling paranoid parent.

Hosts file spam block list

This site has a great spam blocking hosts file that gets rid of tons of ads. Clicking the bat file will install it automatically on windows. If you don't have windows you can just edit the hosts file from the locations specified above.




Tags: spam block hosts file, redirect domains to ips, block domains windows, block sites, mac linux, osx, prank



stumble digg delicious


Blog by Jimmy Ruska
Add me: Youtube, Twitter, Facebook, MySpace

Share:

More OMFG-Good Links

See all Posts in the Funny Pictures category.
Download mp3s faster than limewire using google.
I've made 100+ free video tutorials.
See the best of the internet today on one page.