Hi,
The fast easy way of doing this is to edit your hosts file. You will
find this file probably under :
c:\WINNT\system\etc\hosts
Running a search for hosts will find it pretty fast. You edit this
with a basic text editor. Don't open it in Word or anything like that.
Notepad.exe is good, or the program you use to create webpages might
work as well. You want it to remain a basic text file.
There will already be some entries in there, and adding them is really
easy. You'll see something like :
127.0.0.1 localhost
193.125.201.50 msn.com
193.125.201.50 search.msn.com
193.125.201.50 auto.search.msn.com
What you want to do is add your computer's IP address and then the
name of your URL. Something like
192.168.1.254 www.mydomain.com
If your computer is getting it's IP address from DHCP, then you want
to use the localhost IP address.
127.0.0.1 www.mydomain.com
I use a tab between the IP address and the URL. The windows
documentation suggests that any space will do, but I'm a Unix person,
so I always use a tab.
The hosts file is the first place your computer checks for name
resolution, even if you were running your own DNS server on this
computer, the hosts file is checked first. The first match found by
your computer is used. So if it is in hosts, then that's where the
system goes looking for resolution.
The 127.0.0.1 address is called a loop back address. It resolves to
your machine even if you don't have a working network card most of the
time.
If you have your Web server program (Apache?) set up for virtual
hosts, then this should work for your other URL names as well.
127.0.0.1 www.myotherwebsite.com
127.0.0.1 www.andthisonetoo.com
After adding the entries you want to your hosts file. Save and exit
the file, and close all your browsers. You shouldn't have to reboot
your computer, I've never had too. Open back up your browser then and
type in your URL. All should be right with your world again.
The hosts file has other uses as well. Let's say your very favorite
website for geek news has started placing a nasty banner ad at the top
of the page. You could resolve the sever for those banner ads to your
localhost address as well, and poof! no more banner ads will be seen
at the top of that page. Go to
www.slashdot.org
see the banner ad.
Add these two lines to your hosts file.
127.0.0.1 servedby.advertising.com
127.0.0.1 images.slashdot.org
Restart your browser
and no more banner ads. Of course in this example you won't see the
other images as well, but sometimes that's the price we pay for an ad
free world.
thanks,
webadept-ga |