Fix Microsoft 365 Custom Domain Email After DNS Changes
Question details
Restore custom domain email delivery after changing name servers or DNS records during a website hosting move.

- Product
- Microsoft 365 and Exchange Online
- Device & OS
- not provided
- Scenario
- A custom domain is used for both a website and Microsoft 365 email, and the website hosting or DNS configuration has changed.
- Observed behavior
- Email delivery may stop after DNS changes, and a website or application may report SMTP relay errors if it still uses outdated mail settings.
Identify the domain's current authoritative DNS provider and confirm that you can edit its records. Have access to the Microsoft 365 admin center, the website or application mail settings, and any bounce messages.
Restore the Microsoft 365 DNS records without disrupting the website
Use this solution when email stopped after changing name servers or moving website hosting.
In the Microsoft 365 admin center, go to Settings > Domains, select the affected domain, and review its DNS records and status.
Sign in to the provider hosting the domain's current name servers and open its DNS management page. Compare the MX record, SPF TXT record, autodiscover record, and any other records required by Microsoft 365 with the values shown in the admin center.
Add or update the required records in the active DNS zone. Keep the website's A or CNAME records pointing to the web host; the MX record controls email routing, not website traffic. If other services send mail for the domain, include their authorized senders in the existing SPF record rather than creating a second SPF record.
Return to Settings > Domains in the Microsoft 365 admin center and run the DNS check. After the changes propagate, send a test message to the custom domain from an external account and open the domain in a browser to check the website.

Check website SMTP settings and trace affected messages
Use this solution if mailbox delivery works but a website or application still produces relay errors.
Work with Office documents in WPS Office
WPS Office is a free, lightweight alternative for everyday document work, with a familiar interface and compatibility that makes moving existing Office files straightforward. It does not repair Microsoft 365 DNS or SMTP settings.

Frequently Asked Questions
Can my domain point to my website and use Microsoft 365 for email?
Yes. In your authoritative DNS zone, use the web host's A or CNAME records for the website and the Microsoft 365 MX record for incoming email. Add the other Microsoft 365 records required for your domain as well.
Where can I find the correct Microsoft 365 DNS records?
In the Microsoft 365 admin center, go to Settings > Domains and select your domain. Review the DNS records and status shown there, then compare them with the records at your current DNS provider.
Why does my website still get SMTP relay errors after I fix the MX record?
The MX record routes incoming mail; it does not configure how a website sends mail. Check the website's SMTP server, port, sender, and authentication settings for references to the previous provider.
How can I tell whether Microsoft 365 received a failed message?
In the Exchange admin center, go to Mail flow > Message trace and search by sender, recipient, and time. If no matching message appears, investigate the sending application or service as well as the bounce message.




