Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm on my localhost PC. I need to add an entry that maps our public site to our dev server.

I tried several things with no luck:

192.168.1.40 oursite.com // where the IP here is our internal dev server or devserver oursite.com oursite.com devserver

I'm not sure what I'm doing wrong here.

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Remember that oursite.com is different than www.oursite.com, so make sure to include the full domain name in the host file. Also your browser and OS will cache dns responses, so you may need to clear the browser cache and run ipconfig -flushdns on the command line before the host file response starts working.

share|improve this answer
    
I just don't know which above that I tried is the correct syntax. Thanks. –  user16521 Apr 26 '10 at 2:37
    
is it IP space domain name where IP is the Ip you want to point the domain name to? –  user16521 Apr 26 '10 at 2:37
    
Yes.. IP then space or tab then domain name. See youtube.com/watch?v=U-N9cryU_fQ –  Greg Bray Apr 26 '10 at 16:59
    
Nice. I did not realize we registered our domain name with www or without the www and that made all the difference when specifying it in the hosts file...it has to be the one you registered...include or not to include the www is where the problem lied. –  user16521 May 21 '10 at 16:30
1  
Just fyi you still register oursite.com, but in terms of DNS and Host files www.oursite.com is different than oursite.com. Most people have them point to the same IP address or have one be a CNAME of the other, but just remember that they are not the same thing and the host file needs either entries for both or just one entry for whichever version you type into your browers. –  Greg Bray May 21 '10 at 16:43

HI Coffee,

For the sake of being thorough, the "// where the IP here is our internal...etc." is not in the actual hosts file right?

Not sure if you are doing this already, but you you should ping "oursite.com" after adding that line in your hostfile, if it responds from 192.168.1.40 you know the hosts file is working and perhaps its a host header or other webserver issue that preventing it from displaying in your browser.

Cheers, iain

share|improve this answer
    
no the // was just for this post...showing a comment..it's not in the hosts file. –  user16521 Apr 26 '10 at 2:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.