Additional info: I added 123.123.123.123 www.mywebsite.com in the /etc/hosts file of a remote server and wget www.mywebsite.com (from the remote server) shows me the contents of the new server. so the problem is local

Thanks rch,

Yes, I've checked the spelling on /etc/hosts.

I do not have anything else running on the server, so I should see an error message or the default apache welcome page, but instead I'm seeing the old website.

I can connect using telnet but see no message and If I ping the address, the ip is the one of the new server.

Does anyone know how to point an address to a different ip using a proxy server (I'm using Ubuntu).

Thanks

Hi, I have still nothing installed on the new server. I should see the default "It works!" Apache message. But instead, I'm seeing the old site. And this issue is not related with the server, because I added:

123.123.123.123 daniweb.com www.daniweb.com

into /etc/hosts and I still see this page after flushing DNS.

Thanks JorgeM,

You are right. I want my local IP mapping to take precedence over the records defined in the DNS zone.

I pinged the hostname and the get the expected result, i.e. the IP is the new one.

Regarding the browser. I tied using Firefox, Chrome, Midori and also wget command. In all cases I cleared the cache and reloaded the page. Midori private browsing doesn't save nameserver cache. Firefox DNS Flusher add on clears the ns cache and loads the page using the new ip. Wget linux command doens't have a nameserver cache as far as I know.

I've done it before to test remote servers, but I just cannot understand why this time it isn't working.

I am transfering a website to a new server. I need to test this server, to check if the CMS runs fine on it. To do this, I need to open the website from a browser.

Thanks again for your comments.

Thanks for your reply rubberman.

It's not my intention to user another DNS server, just to point one adress to another ip of my choice.

Can this be done using the network manager tool?

Under Linux, the /etc/hosts file can be used to override dns definitions, i.e. to point an hostname to a different ip.

I need to test a new VPS. So I added a line in the /etc/hosts file:

123.123.123.123 www.mywebsite.com

I flushed all caches and went to www.mywebsite.com , but it still shows the old site. In the new site, I should see the default apache file "It Works!"

I used ping to test the ip and it shows the new ip.

I used wget to retrieve the index.html file, but it retrieves the file from the old server.

I bypassed my router to check if it¡s something related with it, but it isn't.

I booted Windows 7 and edited the hosts file and saw the same behaviour.

I use DNS Flusher Firefox add on to clear DNS cache. I also check using Midori browser private browsing (it doesn't cache DNSs).

I added another line:

123.123.123.123 daniweb.com

This time, I see the this website.

If I add: 127.0.0.1 www.mywebsite.com

I see a not found message from localhost.

I checked using Windows and saw the same behaviour.

Why can't I point a hostname to a new IP ?

Thanks for your help!