Domains and DNS

Point your website to another server without moving your email

Reviewed on 3 min read DNS records email

Sometimes you need the website to point to an external server while email keeps working with us. To do this, you change only the website records and keep the existing mail route.

Before changing anything, get the IP or the records your new provider gives you and save a copy of the current zone. Also check which nameservers are authoritative: if they belong to another provider, you must edit the zone there, not in cPanel.

If the domain uses our DNS, go to Zone Editor in cPanel and click Manage next to the domain.

Separate the mail destination before changing the website

Check the MX record first. If it delivers mail to mail.yourdomain.com and that name is a CNAME that ends up following the root domain, replace that CNAME with an A record pointing to the current IP of the hosting. Note down that IP before you change the website record.

The aim is for the mail server name to keep its own address instead of following the website domain. Do not copy the new web provider's IP into that record.

If the MX already points to mail.yourdomain.com, you don't need to change it. If it points directly to the root domain, change its destination to mail.yourdomain.com after creating the A record above. Don't follow these steps if the MX belongs to Google Workspace, Microsoft 365 or another external service: keep that provider's values.

Finally, change the website records as instructed by the new provider:

  1. Change the A record for the root domain to the new IP.
  2. Check www: it may be a separate A record or a CNAME to the root domain.
  3. Check the AAAA records. An old IPv6 address can make the website fail for only some of your visitors.
  4. Keep the MX, DKIM and DMARC records that belong to email. Check SPF: if it authorises the server through a, changing the website IP can stop authorising the previous sender or unintentionally authorise the new one. Adjust the senders using your email provider's details.
  5. In cPanel's Email Routing, keep Local Mail Exchanger selected if the mailboxes are still on this hosting.

Check both services

After the change, check the website with and without www, and check receiving and sending email, separately. Also test the website's contact forms: the new server may need an authenticated SMTP connection. If your devices use the root domain as their IMAP or SMTP server, update them with the email connection settings and a hostname covered by its certificate.

The exact values may differ in a customised zone; don't replace email records with the ones in this example without first checking what they do.

You may also find useful

Something wrong or out of date? Tell us and we will review it.