Skip to content
dnscheck.app

Guides

DNS Records for Google Workspace and Microsoft 365 Email

Updated 22 November 2026

Email works with a provider through records kept at your domain's DNS host. MX records route mail, and TXT records carry text such as a domain-ownership value. This page covers where to add those records, in what order, and how to check them. The exact MX, SPF, DKIM, DMARC and Autodiscover values come from each provider's own documentation or admin console. It also does not cover mail client setup on phones or desktops.

Which DNS records make email work with a provider

Two record types matter for the first steps of a Google Workspace or Microsoft 365 setup.

Record type What it does on this page
TXT Holds text. Its meaning depends on the domain name where it appears. Here it proves ownership.
MX Routes mail for the domain.

In the DNS standard, mail exchange binding, which is the mechanism behind MX records, is the recommended method for Internet mail routing.

A TXT record holds descriptive text, and what that text means depends on the domain where it appears. Its data is one or more character-strings. The same record type can therefore carry an ownership value at one name and something unrelated at another. Copy the name as carefully as the value.

Both providers also ask for other records, such as SPF, DKIM, DMARC and Autodiscover. Those values are provider-specific. See Get the exact record values from your provider.

Find where your DNS is hosted before you add anything

A record only takes effect when you add it at the DNS provider that your domain's authoritative nameservers use. An authoritative nameserver is a server that holds the official answers for a zone, and a zone is the set of records for your domain. Many people edit records in the registrar's panel while DNS is hosted somewhere else. A record added there is not the one your domain uses.

Check the nameservers with a tool

Use the NS lookup tool to find your domain's nameservers. You can also ask from the command line:

dig NS example.com +short
Resolve-DnsName -Name example.com -Type NS

The first command runs on Linux, macOS and Windows installations that have dig. The second runs in Windows PowerShell.

Read the answer as a list of hostnames. Those hostnames belong to your DNS host. If they belong to your registrar, edit records in the registrar's DNS panel. If they belong to another company, edit records in that company's panel.

Wrong: editing records at the registrar when the NS records name another DNS provider.

NS records for example.com name provider A.
You add the TXT record in registrar B's DNS panel.
Result: the record is never published.

Right: editing records at the provider the NS records name.

NS records for example.com name provider A.
You add the TXT record in provider A's DNS panel.

If you use custom nameservers

Custom nameservers are nameservers that you or a third party set at the registrar, instead of the registrar's own defaults. In that case, add the record at the DNS provider those nameservers belong to. One documented example is a domain moved from Google Domains to Squarespace that uses custom nameservers. There the record goes at that DNS provider, not in Squarespace's DNS records.

Do not move the domain just to verify it

The Microsoft 365 verification guidance this page follows advises against changing nameservers or transferring the domain merely to verify ownership. Find where DNS is hosted now and add the record there.

Get the exact record values from your provider

MX hosts, priorities, SPF, DKIM, DMARC and Autodiscover values differ between providers. Take the name and value from the provider's admin console or documentation, and copy them exactly.

For the Microsoft 365 verification TXT record, Microsoft 365 supplies the name and value.

Use this table as a template for what to fill in:

Type Name Value
TXT (Microsoft 365 verification) copy from the provider copy from the provider
MX copy from the provider copy the mail host and priority from the provider

Before you change anything, save the records you have now:

  1. Look up the current records with the MX lookup tool and the TXT lookup tool.
  2. Copy the results into a text file, or take a screenshot of the DNS panel.
  3. Keep that file until mail has worked correctly for a while after your change.

If a change goes wrong, the saved copy lets you put back what was there.

Once you have pasted the provider's SPF, DKIM and DMARC values, check that they read as intended with the SPF, DKIM and DMARC checkers on this site.

Add the Microsoft 365 verification TXT record without moving your mail

Use these steps when your domain already receives mail somewhere else, such as Google Workspace. They follow Microsoft's instructions for verifying a domain that is currently used with Google Workspace. In those instructions, the admin chooses to add a TXT record to the domain's DNS records and copies the TXT value that Microsoft 365 supplies.

  1. In Microsoft 365, start adding your domain and choose the option to verify with a TXT record.
  2. Copy the name and value that Microsoft 365 shows. Do not retype them.
  3. Add the TXT record at the authoritative DNS host you found in the previous section.
  4. Wait for the record to appear. Microsoft says the change usually takes effect within a few minutes but might take up to 48 hours. Treat that as Microsoft's estimate, not a guarantee.
  5. Return to Microsoft 365 and run the verification.

If Microsoft 365 does not show the domain as verified, check two things. First, confirm the record is at the DNS host that your NS records name. Second, confirm you have run the check in Microsoft 365 after the record appeared. Allow the time described in step 4 before you run it again.

The TXT record only proves that you own the domain. It does not transfer registration or DNS hosting, and it does not redirect email to Microsoft 365. Your existing mail keeps flowing to its current provider.

Wrong: changing nameservers or MX records to "verify" the domain.

Belief: verifying the domain moves my mail, so I change the nameservers.
Result: DNS hosting changes and mail routing may break.

Right: add the verification TXT record and leave delivery unchanged until migration batches finish.

Add the Microsoft 365 verification TXT record at the current DNS host.
Leave the nameservers and MX records as they are.

This page does not cover running Google Workspace and Microsoft 365 together on one domain, including on subdomains. It also does not cover cleaning up old SPF, DKIM or DMARC records after a migration. Follow each provider's documentation for those.

Change MX records only when you are ready to move mail

MX records decide where mail is delivered. The verification TXT record does not. Microsoft's guidance, in its Connect your domain documentation, is to change production MX records only after the email migration batches are complete.

Work in this order:

  1. Note the current MX records.
  2. Add the verification TXT record and run the verification.
  3. Finish the mailbox migration batches.
  4. Only then edit the MX records, using the values from the provider.
  5. Re-check your MX records with the MX lookup tool.

Do not skip step 3. If you edit MX records first, new mail goes to the new provider before your old mailboxes have been copied across.

Check that your records are in place and mail is arriving

A resolver is the server that answers DNS questions for your computer. It is given a domain name plus a query type, such as a host address or mail information. The commands below send that kind of question for your MX and TXT records.

Confirm the record exists

Run these commands before a change to save the current records, and again afterwards to check the result:

dig MX example.com +short
dig TXT example.com +short
Resolve-DnsName -Name example.com -Type MX

The MX answer is a list of lines, each with a priority number followed by a mail host name. The TXT answer is a list of text strings, and your verification value should be one of them. If you add a record and it does not appear, first confirm you edited the DNS host that the NS records name.

You can see the same answers in the browser:

  • Look up your TXT records with the TXT lookup tool to find the verification value.
  • Check where mail is routed with the MX lookup tool.
  • Use the propagation checker to compare answers from different places. Caches can hold an old answer until it expires, so different places may disagree for a while.

If mail still does not arrive

Go through these causes in order:

  • The record was added at the wrong DNS host. Check the NS records again.
  • MX records were changed before the migration finished. Put the saved records back, finish the batches, and change them again.

If your mail provider's records are in place and mail is still affected, check SPF, DKIM and DMARC next with the SPF, DKIM and DMARC checkers on this site. Authentication records are necessary for good delivery, but they do not guarantee inbox placement.

References

Check it yourself

  • NS lookup

    Delegation, lame nameservers, glue, TCP and SOA serials.

  • MX lookup

    Mail servers, priorities, and whether each one resolves.

  • TXT lookup

    TXT records, including SPF and site verification strings.

  • Propagation

    What more than 30 public resolvers return, next to the authoritative answer.

  • SPF

    Syntax, the include tree, and the 10-lookup limit.

  • DKIM

    Find and validate DKIM keys by selector.

  • DMARC

    Policy, alignment, report addresses and syntax.