Google Answers Logo
View Question
 
Q: Name resolution problem ( Answered 5 out of 5 stars,   0 Comments )
Question  
Subject: Name resolution problem
Category: Computers > Operating Systems
Asked by: salman1-ga
List Price: $5.00
Posted: 09 Jun 2003 23:38 PDT
Expires: 09 Jul 2003 23:38 PDT
Question ID: 215445
Let me first describe my system:
 o Windows Server
 o Netgear router

I am running a website. But I can't resolve my domain name from my own
system, even though I can do it from outsite my private-network. How
can I fix this?

Clarification of Question by salman1-ga on 09 Jun 2003 23:39 PDT
I am also running a seconday website using host-headers (on the same
web server); it would be helpful if I could resolve this name as well.

Thanks
Answer  
Subject: Re: Name resolution problem
Answered By: webadept-ga on 10 Jun 2003 05:09 PDT
Rated:5 out of 5 stars
 
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
salman1-ga rated this answer:5 out of 5 stars
Thanks a lot!

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy