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:
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:
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!