You have just moved a site to a new server, tested locally, and everything looks fine — but when you open the domain in a browser, you see a completely different site. Clearing the cache does not help. What is happening?
Problem: A WordPress site has been migrated to a new server but the browser still shows the old site — even though all files and the database on the new server are correct.
Solution: The domain's A record still points to the old server IP, or the local machine's /etc/hosts file is overriding DNS. Update the A record in the DNS provider's control panel and test immediately by temporarily adding the new IP to /etc/hosts while DNS propagates.
The most likely cause is a stale DNS record. The domain's A record still points to the IP address of the old hosting server. Your new site exists on the new server, but every browser (and DNS resolver) is still being directed to the old one.
Verify which IP the domain currently resolves to:
ping your-domain.com
Compare the IP in the ping output with the IP of your new server (visible in the right-hand sidebar of cPanel, or by asking your hosting provider). If they differ, DNS has not propagated yet — or the DNS record has not been updated.
The proper fix: update the DNS A record for the domain to point to your new server's IP. DNS changes can take anywhere from a few minutes to 48 hours to propagate worldwide depending on the TTL value.
Preview the new site before DNS propagates. While waiting for propagation — or if you cannot change the DNS yourself — you can force your local machine to resolve the domain to the new IP by editing the hosts file. This affects only your computer and lets you verify the new site before it goes live everywhere.
Add the following line to your hosts file, replacing the example values with your real IP and domain:
100.200.50.10 your-domain.com www.your-domain.com
The hosts file location:
— Linux / macOS: /etc/hosts (edit with sudo nano /etc/hosts)
— Windows: C:\Windows\System32\drivers\etc\hosts (open Notepad as Administrator)
After saving, open your browser and navigate to the domain — you will now see the new server's site. Remember to remove the line from hosts once DNS has propagated, otherwise your browser will keep ignoring the real DNS record.
NOTE: Some browsers and operating systems aggressively cache DNS lookups. If the hosts file edit does not take effect immediately, flush your OS DNS cache (sudo dscacheutil -flushcache on macOS, ipconfig /flushdns on Windows) and clear the browser's DNS cache.