Jump to content

Problem with hosts file


asmith

Recommended Posts

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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".)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.