asmith Posted December 2, 2009 Share Posted December 2, 2009 Hi, I'm moving my site to another server. But before I actually move it, I wanna test my new server without having to change my domain nameservers. In windows hosts file when I try: (xp) 127.0.0.1 www.example.com It works and it shows me the localhost, but it doesn't work when I try any other IP than 127.0.0.1 and it solves the name to the current running server, like I haven't set any IP address. Any idea why it only works for 127.0.0.1? Quote Link to comment https://forums.phpfreaks.com/topic/183791-problem-with-hosts-file/ Share on other sites More sharing options...
jcombs_31 Posted December 2, 2009 Share Posted December 2, 2009 Can you give an example of your hosts file that you are trying. Quote Link to comment https://forums.phpfreaks.com/topic/183791-problem-with-hosts-file/#findComment-970072 Share on other sites More sharing options...
asmith Posted December 2, 2009 Author Share Posted December 2, 2009 windows\system32\drivers\etc\HOSTS That's the file, and this is its content: (xx.xx.xx.xx as my new server ip address, it works for 127.0.0.1 ip address but not for any other) # Copyright © 1993-1999 Microsoft Corp. # # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. # # This file contains the mappings of IP addresses to host names. Each # entry should be kept on an individual line. The IP address should # be placed in the first column followed by the corresponding host name. # The IP address and the host name should be separated by at least one # space. # # Additionally, comments (such as these) may be inserted on individual # lines or following the machine name denoted by a "#" symbol. # # For example: # # 102.54.94.97 rhino.acme.com # source server # 38.25.63.10 x.acme.com # x client host # xx.xx.xx.xx www.mysite.com 127.0.0.1 localhost Quote Link to comment https://forums.phpfreaks.com/topic/183791-problem-with-hosts-file/#findComment-970075 Share on other sites More sharing options...
corbin Posted December 2, 2009 Share Posted December 2, 2009 Hrmmm, the only thing I can think of is that www.mysite.com will be remapped, but not mysite.com. In other words, subdomains and domains are separate. Aside from that, I doubt it's the problem, but you could try flushing your DNS cache. (Open command prompt and type in "ipconfig /flushdns".) Quote Link to comment https://forums.phpfreaks.com/topic/183791-problem-with-hosts-file/#findComment-970083 Share on other sites More sharing options...
jcombs_31 Posted December 2, 2009 Share Posted December 2, 2009 Are you trying to resolve via your browser by navigating to the page? Have you tried to ping the hostname? Quote Link to comment https://forums.phpfreaks.com/topic/183791-problem-with-hosts-file/#findComment-970092 Share on other sites More sharing options...
premiso Posted December 2, 2009 Share Posted December 2, 2009 As corbin stated, I am sure it is the www. that is throwing it of, remove that part then after you do it try this to flush the DNS and see if it works: Start > Run > gpupdate /force After it is done refreshing the policy try to go to that site and see if it took. Quote Link to comment https://forums.phpfreaks.com/topic/183791-problem-with-hosts-file/#findComment-970109 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.