All ArticlesDNS2026-11-06T19:12:59+08:00

Restored an Account in WHM and the Site Still Points to the Old Server IP?

After a WHM transfer or backup restore, the restored zone can keep A records for the previous server, so the site resolves to the wrong host. Readers learn how to query the local zone with dig, spot stale IPs, and correct them before changing nameservers.

You moved an account to a new cPanel server, the restore finished without errors, and the site loads fine when you test it directly. Then you switch the nameservers to the new server and visitors still land on the old host, or on nothing at all. More often than not, the cause is the zone itself: the restored DNS zone still contains A records for the previous server's IP.

This is easy to miss, because nothing about the restore looks broken. The fix is simple once you can see the problem. The useful habit is checking the local zone on the new server before any nameserver change, so the new nameservers start answering with the right addresses from the first query.

Why the restored zone can keep the old address

A cPanel account backup includes the DNS zone for each domain on the account. When WHM restores that backup, or when the Transfer Tool pulls the account across, the zone gets written to the new server along with the files, databases, and mail.

The restore process typically tries to swap the old server's IP for the new account IP. That swap works best when the records point exactly at the address the source server had on file for the account. Records that don't match that address cleanly often come through unchanged. That's common in a few situations:

  • The old server was behind NAT, so the zone held a public IP while the account was assigned a private one.
  • The account was moved between servers before, and some records still hold an even older IP.
  • Someone added subdomains or mail-related hostnames by hand with a hardcoded address.
  • The zone has AAAA records for an IPv6 address the new server doesn't have.
  • The SPF TXT record lists the old server with an ip4: mechanism. That isn't an A record, but it goes stale the same way.

The exact behavior depends on the cPanel version and how the backup was made, so don't assume either way. Check it.

This is also why the symptom is confusing for site owners. Testing with a hosts file entry or curl --resolve bypasses DNS completely, so the new server looks perfect. The stale record only matters once real resolvers start asking the new nameservers.

Find out which IPs belong to this server and this account

Before you can spot a stale IP, you need to know which addresses are correct. Two things matter: the addresses bound on the new server, and the IP the account is assigned to.

# IPv4 addresses bound on this server
ip -4 -o addr show | awk '{print $4}'

# IPv6 addresses, if the server has any
ip -6 -o addr show scope global | awk '{print $4}'

# IP assigned to the cPanel account (replace username)
grep '^IP=' /var/cpanel/users/username

If the server sits behind NAT, which is common on some cloud platforms, the account IP shown here may be a private address like 10.x.x.x. The zone should still hold the public address that maps to it. Check how NAT is configured on your server before you decide which address belongs in DNS.

Write down the correct public IPv4 (and IPv6, if any). Every A or AAAA record in the zone that should point at this server needs to match one of those values.

Query the local zone, not the internet

The key move is asking the DNS server on the new machine directly. A plain dig example.com goes through your normal resolver, which still follows the current delegation and returns whatever the old nameservers say. That tells you nothing about the zone you just restored.

Pointing dig at 127.0.0.1 asks the local DNS service (BIND or PowerDNS, depending on the setup) to answer from its own zones. It works even though the domain isn't delegated to this server yet, because authoritative servers answer for zones they hold regardless of what the registry says.

# Ask the local DNS server for the common hostnames
for h in example.com www.example.com mail.example.com webmail.example.com ftp.example.com; do
  echo h:(dig @127.0.0.1 +short A $h)
done

# Show every A, AAAA, and SPF ip4/ip6 entry in the zone file, with line numbers
grep -nE '[[:space:]](A|AAAA)[[:space:]]|ip[46]:' /var/named/example.com.db

The loop covers the hostnames people notice first. The grep catches everything else, including custom subdomains, autodiscover, cpanel, and the SPF record. Read the output line by line and compare each address against the list from the previous step.

A few patterns usually stand out:

  • The apex and www point at the new IP, but mail still points at the old one. Webmail and IMAP then go to the old server while the site works fine.
  • Everything uses the new IP except one or two subdomains someone added later.
  • An AAAA record points at the old server's IPv6 address. IPv6-capable visitors reach the old host while IPv4 visitors reach the new one, which looks random from the outside.
  • The SPF record still says ip4: with the old address, so mail sent from the new server starts failing SPF after the move.

If dig @127.0.0.1 returns nothing at all, the zone may not have loaded. That's a separate problem worth solving first, because the new nameservers would answer with nothing too.

Not every address that differs is wrong. A subdomain might point at an external service on purpose, such as a separate mail provider or a SaaS app. Only change records that were meant to follow the server.

Fix the stale records and confirm the change

The safest place to fix records on a cPanel server is WHM's DNS zone editor, or the Zone Editor in cPanel for a single account. Editing through the interface usually increments the zone's SOA serial and reloads the DNS service for you. That matters, because other nameservers and caches use the serial to decide whether the zone changed.

Editing /var/named/example.com.db by hand is possible, but then you're responsible for bumping the serial and reloading the right service, and the steps differ between BIND and PowerDNS setups. Unless you have a reason to, stick with the interface. If you do edit the file, take a copy of it first.

For each stale record, change the address to the correct one from your list. Update the SPF TXT record too, if it lists the old server. Then run the same checks again and compare the serial:

# The serial (third field) should be higher than before the edit
dig @127.0.0.1 +short SOA example.com

# Re-run the zone file check; no old IPs should remain
grep -nE '[[:space:]](A|AAAA)[[:space:]]|ip[46]:' /var/named/example.com.db

# Confirm the new server actually serves the site (replace with your new IP)
curl -sI --resolve example.com:443:203.0.113.10 https://example.com/

The curl --resolve check proves the web server answers correctly for the domain on the new IP, without touching DNS. If you want more detail on that step, see Test the New Server With curl --resolve Before You Change Nameservers. The two checks complement each other: curl confirms the server is ready, and dig confirms the zone sends visitors to it.

Check every nameserver that will answer for the domain

If the new server is the only nameserver for the domain, 127.0.0.1 gives you the whole picture. Many setups have more than one, though: a DNS cluster, a pair of dedicated nameserver machines, or an external DNS host that holds a copy of the zone.

Find the NS records in the restored zone with dig @127.0.0.1 +short NS example.com, then ask each of those servers directly. Use dig @ns1.example.net +short A example.com with each nameserver name in turn, and check mail and www the same way. Every nameserver should return the same new IP and the same SOA serial. If one still returns the old address, the zone hasn't synced to it, and visitors whose resolver picks that server will reach the old host.

Whether WHM pushes zone edits to other nodes depends on how the cluster is configured. A node set to standalone, for example, won't receive changes. Verify by querying, not by assuming the sync worked.

Only when every nameserver gives the right answers is it a good time to change the nameservers at the registrar. After that switch, remember that resolvers may keep cached answers from the old setup until their TTL expires. Some visitors still reaching the old server for a while is expected, as long as the new nameservers answer correctly.

A short routine worth keeping

After any WHM restore or transfer, before anyone touches the nameservers: list the server's real IPs, query the local zone with dig @127.0.0.1, grep the zone file for A, AAAA, and SPF entries, fix anything stale through the zone editor, and confirm every listed nameserver returns the same answer. It's a few minutes of read-only checks. It catches the kind of problem that otherwise shows up as a vague report that the site still loads from the old server, at a point where cached DNS makes it slower to clean up.