Microsoft 365 email on your own domain: the DNS records, step by step
The DNS records Microsoft 365 needs on your own domain: verification TXT, MX, autodiscover, SPF, DKIM and DMARC, with values from Microsoft's docs.
On this page
Short answer: Microsoft 365 email on your own domain needs six kinds of DNS record. You add a TXT record to verify the domain and an MX record pointing to Exchange Online (priority 0). Then come a CNAME for autodiscover → autodiscover.outlook.com, an SPF TXT record (v=spf1 include:spf.protection.outlook.com -all), two DKIM CNAMEs (selector1._domainkey and selector2._domainkey) and a DMARC TXT record at _dmarc. In GetNameDot's DNS editor, the Microsoft 365 preset adds the MX, SPF and autodiscover records in one click. You add verification, DKIM and DMARC by hand.
The values below come from Microsoft Learn, checked on 2 November 2026:
- Add DNS records to connect your domain
- External DNS records for Microsoft 365
- Set up DKIM
- Set up SPF
- Set up DMARC
The records at a glance
| Purpose | Name (host) | Type | Value | Where the value comes from |
|---|---|---|---|---|
| Verify the domain | @ | TXT | MS=ms… (unique) | Admin center, when you add the domain |
| Receive mail | @ | MX, priority 0 | yourdomain-com.mail.protection.outlook.com (or a .mx.microsoft value) | Admin center |
| Outlook auto-configuration | autodiscover | CNAME | autodiscover.outlook.com | Fixed |
| SPF | @ | TXT | v=spf1 include:spf.protection.outlook.com -all | Fixed, if Microsoft is your only sender |
| DKIM | selector1._domainkey, selector2._domainkey | CNAME | Tenant-specific | Defender portal |
| DMARC | _dmarc | TXT | v=DMARC1; p=none; rua=mailto:… | You choose policy and report address |
Microsoft uses a TTL of 3600 seconds (1 hour) in its examples. That is also the default in our editor. Its records page notes that Exchange Online only supports TTL values under 6 hours.
Before you start, open the domain in GetNameDot: My domains → your domain → Manage DNS records. The editor works when the domain uses our nameservers ("Our DNS"), which is the default for domains registered here. If the domain uses another DNS provider, add the same records there.
Step 1: Add the domain and verify it
In the Microsoft 365 admin center, go to Settings → Domains → Add domain and enter your domain. Choose to verify with a TXT record. The wizard shows a value that starts with MS=.
In our editor:
- Click + Add record.
- Set the name to
@, the type to TXT, and paste the value exactly as shown. - Click Save DNS records, then go back to Microsoft and click Verify.
Microsoft's add-a-domain page says verification can take up to 10 minutes. Some registrars may need up to 48 hours. You can remove the TXT record after the domain is verified, but leaving it does no harm.
Step 2: MX, SPF and autodiscover with the preset
Click "Preset: Microsoft 365 mail". It adds three rows:
| Name | Type | Priority | Value |
|---|---|---|---|
@ | MX | 0 | yourdomain-com.mail.protection.outlook.com |
@ | TXT | — | v=spf1 include:spf.protection.outlook.com -all |
autodiscover | CNAME | — | autodiscover.outlook.com |
The preset builds the MX host from your domain name, with dots turned into dashes. That is the classic Microsoft format. Compare it with the MX value in your admin center before you save. Microsoft has announced that newly added domains get MX hosts under mx.microsoft, which support DNSSEC and DANE for inbound mail, with the rollout scheduled during 2026. An example from Microsoft's SMTP DANE documentation is contosotest-com.o-v1.mx.microsoft. If the admin center shows a value like that, paste it over the preset's MX value.
Also before saving:
- Delete any other MX records, for example those of a previous mail host. Leftover MX records can send part of your mail to the old provider.
- Keep exactly one SPF record. If the domain already has a TXT record starting with
v=spf1, merge the two. Microsoft's SPF guide recommends one SPF record per domain and no more than 10 DNS lookups. Another service that sends as your domain gets its owninclude:in the same record.
Then click Save DNS records and let the admin center check the records.
Records you may not need
The admin center offers more records under "Advanced options":
- Teams. If you use Teams alone and talk to users outside your organisation, Microsoft lists one SRV record:
_sipfederationtls._tcp→sipfed.online.lync.com, port 5061. Older guides also listsipandlyncdiscoverCNAMEs, but Microsoft's current records page no longer includes them. - Intune device enrolment. Two CNAMEs,
enterpriseregistration→enterpriseregistration.windows.netandenterpriseenrollment→enterpriseenrollment-s.manage.microsoft.com. You only need them if you use Intune.
Our editor supports the record types involved: A, AAAA, CNAME, MX, TXT, SRV, CAA and NS.
Step 3: Turn on DKIM
DKIM signs your outgoing mail, so receivers can confirm it came from your domain. Microsoft 365 publishes the keys itself. You only add two CNAMEs that point to them.
- Open the Defender portal's DKIM page (Email & collaboration → Policies & rules → Threat policies → Email authentication settings → DKIM) and select your domain.
- Copy the two CNAME values it shows for
selector1._domainkeyandselector2._domainkey. - In our editor, add both as CNAME records and save.
- Back in Defender, switch on Sign messages for this domain with DKIM signatures.
The values are tenant-specific, so don't copy them from another guide. Domains added since May 2025 get the newer format, ending in .dkim.mail.microsoft, such as selector1-contoso-com._domainkey.contoso.n-v1.dkim.mail.microsoft. Older domains keep the format that ends in .onmicrosoft.com. Microsoft notes that detecting the new CNAMEs can take a few minutes, or longer.
Step 4: Add DMARC
DMARC tells receiving servers what to do with mail that fails SPF and DKIM, and where to send reports. Microsoft's DMARC guide recommends a gradual rollout:
- Start with
v=DMARC1; p=none; pct=100; rua=mailto:<a mailbox you read>on the host_dmarc. - Read the aggregate reports until every legitimate sender passes.
- Move to
p=quarantine. Microsoft suggests steppingpct=through 10, 25, 50, 75 and 100. - Finish with
p=reject.
Microsoft 365 doesn't send forensic (ruf) reports, so only rua matters here.
Step 5: Check everything
| Check | How |
|---|---|
| Domain verified | Admin center lists the domain as verified with no missing records |
| MX | dig example.com MX shows only the Microsoft host |
| SPF | dig example.com TXT shows exactly one v=spf1 record |
| Autodiscover | dig autodiscover.example.com CNAME returns autodiscover.outlook.com |
| DKIM | The Defender portal shows DKIM signing enabled for the domain |
| DMARC | dig _dmarc.example.com TXT returns your record |
| End-to-end | Send to an outside mailbox and check the headers for SPF, DKIM and DMARC "pass" |
Moving mail without losing messages
If the domain already receives mail somewhere else, the MX change is the moment of truth. Resolvers that cached the old MX keep delivering there until that record's TTL runs out. Lower the old MX record's TTL to 5 minutes a day before you switch, keep the old mailbox open for a few days, and raise the TTL back to 1 hour afterwards. Our guide to DNS propagation time explains the timing in detail.
Common problems
| Problem | Likely cause | Fix |
|---|---|---|
| Verification fails | TXT pasted with extra spaces, or added at a DNS host the domain doesn't use | Paste the value again; check which nameservers the domain uses |
| Admin center says the MX is wrong | Preset MX doesn't match a newer .mx.microsoft value | Replace the MX value with the one the admin center shows |
| SPF "permerror" | Two SPF records, or more than 10 lookups | Merge into one record; remove unused includes |
| DKIM can't be enabled | CNAMEs not published yet, or the names mistyped | Check dig selector1._domainkey.example.com CNAME, then try again |
| Editor says "uses custom nameservers" | DNS is hosted elsewhere | Add the records at that provider, or switch the domain back to our DNS on its page |
Domains that never send mail
If you own extra domains, such as typo or defensive registrations, that should never send email, Microsoft's guidance is to publish v=spf1 -all and a DMARC record with p=reject. Our brand protection checklist lists the complete "no email" set. With bulk domain management you can point those domains at our DNS 50 at a time.
Using Google instead? See Google Workspace email DNS setup, or the short help article on email records.
Frequently asked questions
Which DNS records does Microsoft 365 need for email?
A TXT record to verify the domain, an MX record that points mail to Exchange Online, a CNAME for autodiscover (optional but highly recommended), an SPF TXT record with include:spf.protection.outlook.com, two DKIM CNAMEs and a DMARC TXT record. The exact MX and DKIM values are shown in the Microsoft 365 admin center and Defender portal.
What is the Microsoft 365 MX record?
For many domains it is your domain with dots replaced by dashes, followed by .mail.protection.outlook.com, with priority 0. Microsoft has started provisioning some new domains with an MX ending in .mx.microsoft instead, so always copy the value your admin center shows.
Is the autodiscover CNAME required?
Microsoft calls it optional but highly recommended. It points autodiscover.yourdomain to autodiscover.outlook.com and lets Outlook and phones find the mailbox settings automatically.
How long does Microsoft 365 domain verification take?
Microsoft says TXT verification can take up to 10 minutes, and that some registrars may need up to 48 hours. If it fails, check that the TXT value was pasted exactly and that the domain uses the nameservers where you added the record.
Can I use Google Workspace and Microsoft 365 on the same domain?
Only one provider can receive mail through the domain's MX records, but both can send. If both send as your domain, list both in a single SPF record, for example v=spf1 include:_spf.google.com include:spf.protection.outlook.com -all, and set up DKIM in both.