DEV Community

Mira John
Mira John

Posted on

Preserve email DNS when moving a client website

Moving a client's website and moving their email are separate jobs. A DNS change can accidentally combine them.

The new website loads. The launch is signed off. Then someone notices that enquiries are bouncing, outgoing messages fail authentication, or Outlook has stopped finding the mailbox settings.

The useful check is a before-and-after comparison of the public mail configuration. Do it before changing nameservers, repeat it against the new authoritative servers, and send test messages after the move.

I build DNS Notify. Here is a practical sequence for web agencies moving a site while leaving the client's email service in place.

1. Record the current authoritative nameservers

Find the domain's nameservers and keep the zone export from the existing DNS provider. Confirm who controls the registrar and which provider will serve the new zone.

dig client.example NS +short
Enter fullscreen mode Exit fullscreen mode

Use an authoritative server from that result for the record checks. Replace ns1.provider.example and client.example with the client's actual values.

dig @ns1.provider.example client.example MX +noall +answer
dig @ns1.provider.example client.example TXT +noall +answer
dig @ns1.provider.example _dmarc.client.example TXT +noall +answer
Enter fullscreen mode Exit fullscreen mode

This captures the public answers at the source. Save the record names, types, priorities, values and TTLs with the launch notes.

2. Preserve the mail records in the new zone

Keep the existing configuration unless an email migration is part of the agreed work.

Record What to preserve
MX Every intended mail exchanger and its priority
SPF The existing v=spf1 TXT policy, including authorised sending services
DKIM Each active selector's TXT or CNAME record
DMARC The policy at _dmarc, including reporting destinations
Provider-specific records Verification records, Autodiscover and other records required by the current mail provider

A website host's default zone is not a complete inventory of the client's mail configuration. Compare the records against the zone export and the email provider's current settings.

For common configurations, the Microsoft 365 DNS setup guide and Google Workspace DNS setup guide show the relevant records and link to the provider's administration portal.

3. Check DKIM by its active selector

Read a recently sent message's DKIM-Signature header. The d= value gives the signing domain and s= gives the selector.

Query that selector under _domainkey at the signing domain:

dig @ns1.provider.example selector1._domainkey.client.example TXT +noall +answer
dig @ns1.provider.example selector1._domainkey.client.example CNAME +noall +answer
Enter fullscreen mode Exit fullscreen mode

Microsoft 365 commonly uses selector CNAMEs; other providers publish a TXT key directly or use their own selector names. Preserve the actual record type and value the provider supplies.

If the record is missing, use the focused Microsoft 365 DKIM guide or Google Workspace DKIM guide to restore the correct configuration.

4. Keep one SPF policy at each sending domain

Several TXT records at the domain can be normal. Two separate TXT records beginning v=spf1 are not: SPF evaluation returns permerror when it selects more than one SPF record.

Preserve the existing policy and merge any genuinely required new sender into it. A web host's suggested SPF record should not replace the client's Microsoft 365, Google Workspace or transactional-mail authorisation without checking which systems still send mail.

The SPF setup guide covers the record and lookup checks. RFC 7208 section 4.5 defines the multiple-record result.

5. Query the new servers before changing delegation

Once the new zone is ready, query each new authoritative server directly for the saved names. Compare the answers with the intended baseline, including the active DKIM selectors.

Then change the nameserver delegation at the registrar. During the transition, keep the records consistent on the old and new providers while cached delegations expire. Query both sets to confirm that either path returns the intended configuration.

The nameserver migration runbook is a useful companion for the website and delegation checks.

6. Test the messages, not just the DNS records

Send an external message to the client's business address and reply from the client mailbox. Check the receiving system's authentication results for SPF, DKIM and DMARC.

Also test the website's contact form. It may use a separate sending service even when staff mail remains in Microsoft 365 or Google Workspace. Confirm that an enquiry reaches the intended inbox and that the notification message authenticates as expected.

Run the Email DNS checker for a readable public record check. Keep the final snapshot with the launch record, alongside the provider details and the contact responsible for email.

7. Keep the accepted records under watch

The records can be correct on launch day and change later during another supplier's DNS edit. That is where independent monitoring earns its place in an agency's maintenance service.

Monitor MX records with DNS Notify and include the SPF, DKIM and DMARC records you have confirmed. Nameserver monitoring watches the delegated server set separately. Alerts show the accepted value beside the changed value, giving the agency something concrete to investigate.

DNS Notify is £5 a month for five domains. It checks public state without asking for access to the client's DNS-provider account, with a seven-day trial and no card required.

Start monitoring the client domains you maintain.

Top comments (0)