Forum Moderators: phranque

Message Too Old, No Replies

How do I overide my local DNS entries for a site?

Need my browser to point to temporary site for testing my migration.

         

Jammer

1:37 pm on Jun 27, 2003 (gmt 0)

10+ Year Member



I am planning to move a number of our sites from one host to another and want to set them up in advance and test them from my pc before I get the DNS changed.

I imagined I would change my local win2000 hosts file with the domain name and the new IP, but alas that does not work.

Is there a way to change what my pc's browser points to on a temporary basis?

Thanks in advance for any help you could offer.

Kind Regards,
Jammer

Receptional Andy

1:40 pm on Jun 27, 2003 (gmt 0)



You're right to use the hosts file, so if it isn't working then there must be some other reason.

The entry should be in the format

123.456.7.89 www.example.com

Naturally, the server must be accepting requests for the domain name on the IP you give. Try adding an erroneous entry into the hosts file like 127.0.0.1 www.webmasterworld.com to see if the hosts file is working. If it is, you will get file not found when trying to access WW.

chris_f

1:43 pm on Jun 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have you got ADS (Active Directory Service) running on you Win2K machine? If so, you can setup a local dns server and change the host record there.

Chris

Jammer

3:05 pm on Jun 27, 2003 (gmt 0)

10+ Year Member



The hosts file works ok for urls that do not really exist, but it seems that it won't overwrite the DNS entry for the real site.
I can ping the fake domain ok using the new IP, but the browser (IE6) still goes to the real site, not my fake one.

And I do not have ADS loaded on my network.

Receptional Andy

3:19 pm on Jun 27, 2003 (gmt 0)



>>The hosts file works ok for urls that do not really exist, but it seems that it won't overwrite the DNS entry for the real site.

But that's exactly how the hosts file works. Rather than lookup the IP via DNS, your browser will always use the IP specified in your hosts file.

The only thing I can think of (if hosts is definitely working ) is a local cache of the site that is getting in the way, or something similar.

Stretch

4:43 pm on Jun 27, 2003 (gmt 0)

10+ Year Member



Yeah I agree with Receptional_Andy - try clearing your cache.

You could also try opening the command prompt and typing:

ipconfig /flushdns

to get rid of any existing dns entries.

Cheers

Stretch

Jammer

7:57 am on Jun 28, 2003 (gmt 0)

10+ Year Member



Still No joy - I have tried all of your suggestions, I have rebooted a dozen times.

It appears something in my browser is not using the hosts file because if I ping from a command prompt it using my hosts entry to resolve name.

Are there any settings in IE I need to look at - I can not find any?

Stretch

10:58 am on Jun 28, 2003 (gmt 0)

10+ Year Member



I suppose as a temporary measure you could add a fake host header to the new site and put that in your hosts file. i.e, if your site is www.example.com add www.test.example.com as a host header in apache/iis on the new server and then add that to your hosts file.

You don't have a conflicting entry in your hosts do you? Or maybe your surfing through a proxy which is somehow caching stuff?

Cheers

Stretch

Jammer

11:16 am on Jun 28, 2003 (gmt 0)

10+ Year Member



I fixed it - I connected manually once with the raw IP to the new site...
from that time on it looks like its now pointing to my 'fake' url.

Thanks for all your suggestions peeps.

Jammer.