I bought a new VPS and I need to move a website to that VPS. I want to test it before going live. I haven't installed nothing yet, just Apache.
Under Linux, the /etc/hosts file can be used to override dns definitions, i.e. to point an hostname to a different ip.
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.
- 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 restarted my PC
- I checked using Linx text browser
If instead I add:
I still see this website. So it's not related with the new VPS
Why can't I point a hostname to a new IP?
Is there another way to do it?
Thanks for your help!