External Domain Name System records for Office 365 - Microsoft 365 Enterprise (2024)

  • Article

External Domain Name System records for Office 365 - Microsoft 365 Enterprise (1)

Want to see a customized list of DNS records for your Office 365 organization? You can find the info you need to create Office 365 DNS records for your domain in Office 365.

Need step-by-step help to add these records at your domain's DNS host, such as GoDaddy or eNom? Find links to step-by-step instructions for many popular DNS hosts.

Sticking around to use the reference list for your own custom deployment? The below list should be used as a reference for your custom Office 365 deployment. You need to select which records apply to your organization and fill in the appropriate values.

Go back to Network planning and performance tuning for Office 365.

Often the SPF and MX records are the hardest to figure out. We've updated our SPF records guidance at the end of this article. The important thing to remember is that you can only have a single SPF record for your domain. You can have multiple MX records; however, that can cause problems for mail delivery. Having a single MX record that directs email to one mail system removes many potential problems.

The sections below are organized by service in Office 365. To see a customized list of the Office 365 DNS records for your domain, sign in to Office 365 and Gather the information you need to create Office 365 DNS records.

External DNS records required for Office 365 (core services)

The TXT record is needed to prove that you own the domain and is required for all customers.

The CNAME record is only required for customers using Office 365 operated by 21Vianet. It ensures that Office 365 can direct workstations to authenticate with the appropriate identity platform.

DNS recordPurposeValue to useApplies to
TXT
(Domain verification)
Used by Office 365 to verify only that you own your domain. It doesn't affect anything else.Host: @ (or, for some DNS hosting providers, your domain name)
TXT Value: A text string provided by Office 365
The Office 365 domain setup wizard provides the values that you use to create this record.
All customers
CNAME
(Suite)
Used by Office 365 to direct authentication to the correct identity platform. More information
Note that this CNAME only applies to Office 365 operated by 21Vianet. If present and your Office 365 isn't operated by 21Vianet, users on your custom domain get a "custom domain isn't in our system" error and aren't able to activate their Office 365 license. More information
Alias: msoid
Target: clientconfig.partner.microsoftonline-p.net.cn
21Vianet customers only

External DNS records required for email in Office 365 (Exchange Online)

Email in Office 365 requires several different records. The three primary records that all customers should use are the Autodiscover, MX, and SPF records.

  • The Autodiscover record allows client computers to automatically find Exchange and configure the client properly.

  • The MX record tells other mail systems where to send email for your domain. Note: When you change your email to Office 365, by updating your domain's MX record, ALL email sent to that domain starts coming to Office 365.Do you just want to switch a few email addresses to Office 365? You can Pilot Office 365 with a few email addresses on your custom domain.

  • The TXT record for SPF is used by recipient email systems to validate that the server sending your email is one that you approve. This helps prevent problems like email spoofing and phishing. See the External DNS records required for SPF in this article to help you understand what to include in your record.

Email customers who are using Exchange Federation need the extra CNAME and TXT record listed at the bottom of the table.

DNS recordPurposeValue to use
CNAME
(Exchange Online)
Helps Outlook clients to easily connect to the Exchange Online service by using the Autodiscover service. Autodiscover automatically finds the correct Exchange Server host and configures Outlook for users.Alias: Autodiscover
Target: autodiscover.outlook.com
MX
(Exchange Online)
Sends incoming mail for your domain to the Exchange Online service in Office 365.
Note: Once email is flowing to Exchange Online, you should remove the MX records that are pointing to your old system.
Domain: For example, contoso.com
Target email server:<MX token>.mail.protection.outlook.com
Time To Live (TTL) Value: 3600
Preference/Priority: Lower than any other MX records (this ensures mail is delivered to Exchange Online) - for example 1 or 'low'
Find your <MX token> by following these steps:
Sign in to Office 365, go to Office 365 admin > Domains.
In the Action column for your domain, choose Fix issues.
In the MX records section, choose What do I fix?
Follow the directions on this page to update your MX record.
What is MX priority?
SPF (TXT)
(Exchange Online)
Helps to prevent other people from using your domain to send spam or other malicious email. Sender policy framework (SPF) records work by identifying the servers that are authorized to send email from your domain.External DNS records required for SPF
TXT
(Exchange federation)
Used for Exchange federation for hybrid deployment.TXT record 1: For example, contoso.com and associated custom-generated, domain-proof hash text (for example, Y96nu89138789315669824)
TXT record 2: For example, exchangedelegation.contoso.com and associated custom-generated, domain-proof hash text (for example, Y3259071352452626169)
CNAME
(Exchange federation)
Helps Outlook clients to easily connect to the Exchange Online service by using the Autodiscover service when your company is using Exchange federation. Autodiscover automatically finds the correct Exchange Server host and configures Outlook for your users.Alias: For example, Autodiscover.service.contoso.com
Target: autodiscover.outlook.com

External DNS records required for Teams

There are specific steps to take when you use Office 365 URLs and IP address ranges to make sure your network is configured correctly.

These DNS records apply only to tenants in Teams-only mode, for hybrid tenants, see DNS implications for on-premises organizations that become hybrid.

DNS recordPurposeValue to use
SRV
(Federation)
Allows your Office 365 domain to share instant messaging (IM) features with external clients by enabling SIP federation.Domain: <domain>
Service: sipfederationtls
Protocol: TCP
Priority: 100
Weight: 1
Port: 5061
Target: sipfed.online.lync.com
Note: If the firewall or proxy server blocks SRV lookups on an external DNS, you should add this record to the internal DNS record.

External DNS records required for Office 365 Single Sign-On

DNS recordPurposeValue to use
Host (A)Used for single sign-on (SSO). It provides the endpoint for your off-premises users (and on-premises users, if you like) to connect to your Active Directory Federation Services (AD FS) federation server proxies or load-balanced virtual IP (VIP).Target: For example, sts.contoso.com

External DNS records required for SPF

Important

SPF is designed to help prevent spoofing, but there are spoofing techniques that SPF cannot protect against. In order to protect against these, once you have set up SPF, you should also configure DKIM and DMARC for Office 365. To get started, see Use DKIM to validate outbound email sent from your domain in Office 365. Next, see Use DMARC to validate email in Office 365.

SPF records are TXT records that help to prevent other people from using your domain to send spam or other malicious email. Sender policy framework (SPF) records work by identifying the servers that are authorized to send email from your domain.

You can only have one SPF record (that is, a TXT record that defines SPF) for your domain. That single record can have a few different inclusions but the total DNS lookups that result can't be more than 10 (this helps prevent denial of service attacks). See the table and other examples below to help you create or update the right SPF record values for your environment.

Structure of an SPF record

All SPF records contain three parts: the declaration that it's an SPF record, the domains, and IP addresses that should be sending email, and an enforcement rule. You need all three in a valid SPF record. Here's an example of a common SPF record for Office 365 when you use only Exchange Online email:

TXT Name @Values: v=spf1 include:spf.protection.outlook.com -all

An email system that receives an email from your domain looks at the SPF record. If the email server that sent the message was an Office 365 server, the message is accepted. If the server that sent the message was your old mail system or a malicious system on the Internet, for example, the SPF check might fail and the message wouldn't be delivered. Checks like this help to prevent spoofing and phishing messages.

Choose the SPF record structure you need

For scenarios where you're not just using Exchange Online email for Office 365 (for example, when you use email originating from SharePoint Online as well), use the following table to determine what to include in the value of the record.

Note

If you have a complicated scenario that includes, for example, edge email servers for managing email traffic across your firewall, you'll have a more detailed SPF record to set up. For more information, see Set up SPF records in Office 365 to help prevent spoofing.

NumberIf you're using...PurposeAdd these includes
1All email systems (required)All SPF records start with this valuev=spf1
2Exchange Online (common)Use with just Exchange Onlineinclude:spf.protection.outlook.com
3Third-party email system (less common)include:<email system like mail.contoso.com>
4On-premises mail system (less common)Use if you're using Exchange Online Protection or Exchange Online plus another mail systemip4:<0.0.0.0>
ip6:< : : >
include:<mail.contoso.com>
The value in brackets (<>) should be other mail systems that send email for your domain.
5All email systems (required)-all

Example: Adding to an existing SPF record

If you already have an SPF record, you need to add or update values for Office 365. For example, say your existing SPF record for contoso.com is the following:

TXT Name @Values: v=spf1 ip4:60.200.100.30 include:smtp.adatum.com -all

Now you're updating your SPF record for Office 365. You edit your current record so you have an SPF record that includes the values that you need. For Office 365, "spf.protection.outlook.com".

Correct:

TXT Name @Values: v=spf1 ip4:60.200.100.30 include:spf.protection.outlook.com include:smtp.adatum.com -all

Incorrect:

Record 1:TXT Name @Values: v=spf1 ip4:60.200.100.30 include:smtp.adatum.com -allRecord 2:Values: v=spf1 include:spf.protection.outlook.com -all

More examples of common SPF values

If you're using the full Office 365 suite and are using MailChimp to send marketing emails on your behalf, your SPF record at contoso.com might look like the following, which uses rows 1, 3, and 5 from the table above. Remember, rows 1 and 5 are required.

TXT Name @Values: v=spf1 include:spf.protection.outlook.com include:servers.mcsv.net -all

Alternatively, if you have an Exchange Hybrid configuration where email is sent from both Office 365 and your on-premises mail system, your SPF record at contoso.com might look like this:

TXT Name @Values: v=spf1 include:spf.protection.outlook.com include:mail.contoso.com -all

These are some common examples that can help you adapt your existing SPF record when you add your domain to Office 365 for email. If you have a complicated scenario that includes, for example, edge email servers for managing email traffic across your firewall, you have a more detailed SPF record to set up. Learn how: Set up SPF records in Office 365 to help prevent spoofing.

Here's a short link you can use to come back: https://aka.ms/o365edns

External Domain Name System records for Office 365 - Microsoft 365 Enterprise (2024)

FAQs

What external DNS records are required for Office 365? ›

The three primary records that all customers should use are the Autodiscover, MX, and SPF records.
  • The Autodiscover record allows client computers to automatically find Exchange and configure the client properly.
  • The MX record tells other mail systems where to send email for your domain.
Oct 18, 2023

How to add DNS records in Microsoft 365? ›

Add or edit custom DNS records
  1. Sign in to the Microsoft 365 admin center.
  2. Go to the Settings > Domains page.
  3. On the Domains page, select a domain.
  4. Under DNS records, select Custom Records; then select Add record.
  5. Select the type of DNS record you want to add and type the information for the new record.
  6. Select Save.
Sep 22, 2023

What is the external DNS name? ›

An external DNS is a publicly accessible third-party domain name server that's generally open for anyone on the internet to access and update. External DNS allows you to query for the IP address of a domain. An external DNS provider is also known as a public DNS provider.

How do I find my domain name for Office 365? ›

To locate your . onmicrosoft.com domain name in the Microsoft 365 admin center:
  1. Open the admin center.
  2. Under Settings, select Domains.
  3. This opens the Domains page, listing all domain names.
Nov 17, 2023

What is an example of an external domain? ›

For example, a single-region CAS deployment with Deployment ID "ibo" would have an External Domain Name of ibo.cloudvdi.net. If the deployment were multi-region in the GCP regions us-east1 and europe-west4, the External Domain Names would be ibo-us-east1.cloudvdi.net and ibo-europe-west4.cloudvdi.net.

Which DNS records do you need? ›

Common DNS records
  • Root domain ( example.com ) Each domain needs to have a record for the root domain. ...
  • www subdomain: ( www.example.com ) It's common to have the www subdomain configured in addition to the root domain. ...
  • MX email records. ...
  • CAA record.

How do I create an external DNS record? ›

Procedure
  1. Log in to the DNS server using the Administrator account.
  2. Click Start, type dnsmgmt. ...
  3. In the navigation tree on the left, right-click Conditional Forwarders. ...
  4. Configure the conditional forwarder. ...
  5. Repeat 3 to 4 to add a forwarding record for the domain name of Access Zone.
  6. Close the DNS Manager window.
Apr 29, 2024

How to publish CNAME records in Office 365? ›

Publishing your DKIM CNAME records in Office 365:
  1. Log in as the administrator to your DNS provider's administration console.
  2. Go to the section for DNS records.
  3. Make fresh CNAME records (Record type: CNAME)
  4. Using the space provided on the Defender interface, paste the copied hostnames and values.
  5. Retain TTL at 3600.
Oct 10, 2023

Where to find MX records for Office 365? ›

Setting Up MX Records for Office 365
  • Step 1: Get the MX record from Office 365. ➡️ Log in to Office 365 and go to the Settings > Domains page. ➡️ The MX record to add is under Required DNS settings. The record follows this format: MX token>. ...
  • Step 2: Add the MX record to your domain's DNS settings. ‍
May 27, 2024

How do I check my external DNS records? ›

Open Command Prompt. Enter nslookup domain.com to perform a DNS lookup for the domain.

What are internal and external DNS records? ›

Internal DNS is for domains that aren't necessarily registered with a domain registrar. They can't be resolved on the Internet. External DNS resolves public, Internet names.

What is the ExternalName service in DNS? ›

An ExternalName service is a special service that does not have selectors and instead uses DNS names. In the service definition, the externalName field must point to the namespace and also to the service which we are trying to access on that namespace.

How do I find my DNS records in Office 365? ›

To locate all other DNS values to set up Office 365, including MX record values for email follow the steps below.
  1. Sign in to the Microsoft Online Portal. .
  2. Select Domains.
  3. On the Domains page, select your domain.
  4. Click Domain settings to see the DNS records to add.
Mar 19, 2024

What domain does Office 365 use? ›

The default domain in Office 365® is {tenantName}. onmicrosoft.com. Until you add your own domain to Office 365, any new users that you create contain the default domain name.

What is the default domain in Office 365? ›

Why do I have an "onmicrosoft.com" domain? Microsoft 365 creates a domain for you, like contoso.onmicrosoft.com, when you sign up with the service. The user ID that you create when you sign up includes the domain, like alan@contoso.onmicrosoft.com.

Do you need a DMARC record with Office 365? ›

If you use only the Microsoft Online Email Routing Address (MOERA) domain for email (for example, contoso.onmicrosoft.com): Although SPF and DKIM are already configured for your *.onmicrosoft.com domain, you need to create the DMARC TXT record for the *.onmicrosoft.com domain in the Microsoft 365 admin center.

What is the CNAME record for Office 365? ›

Office 365 uses a CNAME record to point to the correct authentication endpoint for your location, which ensures rapid authentication response times.

What MX record for Office 365? ›

➡️ The MX record to add is under Required DNS settings. The record follows this format: MX token>. mail.protection.outlook.com.

What DNS records do I need for email server? ›

For smooth email communication, it's essential to configure the DNS MX and A records so that other mail servers can reach your server over the Internet. There are also DNS records such as SPF, DKIM, DMARC, and TLSA for authentication, which help protect against spam and identity theft.

Top Articles
Latest Posts
Article information

Author: Madonna Wisozk

Last Updated:

Views: 5801

Rating: 4.8 / 5 (48 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Madonna Wisozk

Birthday: 2001-02-23

Address: 656 Gerhold Summit, Sidneyberg, FL 78179-2512

Phone: +6742282696652

Job: Customer Banking Liaison

Hobby: Flower arranging, Yo-yoing, Tai chi, Rowing, Macrame, Urban exploration, Knife making

Introduction: My name is Madonna Wisozk, I am a attractive, healthy, thoughtful, faithful, open, vivacious, zany person who loves writing and wants to share my knowledge and understanding with you.