Office Support / Office 365 Admin / Domains

Create DNS records at any DNS hosting provider for Office 365

To confirm that you own a custom domain and then set up Office 365 services, like email, to use the domain, you create several DNS records at your domain's DNS host. The general steps are included in this article. But you may be able to find step-by-step instructions that are specific to that host's website. Check to see if your domain's DNS host is listed in Create DNS records for Office 365.

Why do you have to update DNS records? Watch the video

To set up the records yourself, these are the records to add. Note that to set up your MX record, you'll need to get a specific “MX token” for your domain. The steps below explain how to do that. (Need more help? Get support.)

Important   The exact name of the boxes or fields you type or paste the information into, to create each type of DNS record, are different for each DNS host. Your DNS host may have Help on their website to assist you in mapping the instructions we show here to the exact fields on their website. Remember to check to see if we have step-by-step instructions for your DNS host in Create DNS records for Office 365

Some DNS hosts don’t let you create all of the required record types, which causes service limitations in Office 365. If your domain's host doesn’t support SRV, TXT, or CNAME records, for example, we recommend that you transfer your domain to a DNS host that does support all required records. For a fast, automated process setting up with Office 365, we recommend that you transfer your domain to GoDaddy.

If you have a SharePoint Online Public Website, you can set it up to use your custom domain for the website URL address, like www.your_domain.com.

Note    Typically it takes just a few minutes for DNS changes to take effect. However, it can occasionally take longer for a change you've made to update across the Internet's DNS system. If you’re having trouble with mail flow or other issues after adding DNS records, see Find and fix issues after changing your domain name or DNS records.

Add a TXT record for verification

Before you use your domain with Office 365, we have to make sure that you own it. Your ability to login to your account at your domain's DNS host (or domain registrar) and create the DNS record proves to Office 365 that your own the domain. Follow the steps below.

Note    This record is used only to verify that you own your domain; it doesn’t affect anything else. You can delete it later, if you like.

Task

Gather information for creating the TXT record from Office 365. In some cases, you may need to use a MX record, if your DNS host doesn't allow you to create TXT records.

You'll copy the Destination or Points to Address value that you've tracked down, to use in the next step. (We recommend copying and pasting this value, so that all of the spacing stays correct.)

Find the area on your DNS host’s website where you can create a new record.

  1. Sign in to your DNS host’s website.

  2. Choose your domain.

  3. Find the page where you can edit DNS records for your domain.

Create a new TXT (or in some cases, MX) record.

  1. Create a new TXT or MX record.

    Notes    You will create only one or the other of these records, not both.

    TXT is the preferred record type; but some DNS hosts don’t support it, in which case you can create an MX record for verification instead.

    If you create a TXT record, use these values:

    Record Type

    Host

    TXT Value

    TTL

    TXT (Text)

    Do one of the following: Type @ or leave the field empty or type your domain name.

    Note   Different DNS hosts have different requirements for this field.

    MS=msXXXXXXXX

    Note   You enter the whole value, including the MS= part. But this is an example value. Use your specific Destination or Points to Address value here, from the table in Office 365.

    1 hour

    If you create an MX record, use these values:

    • For Alias or Host Name, type or paste either @ or your domain name.

    • For Value, type or paste the Destination or Points to Address that you just copied from Office 365.

    • For Priority, to avoid conflicts with the MX record used for mail flow, use a lower priority than the priority for any existing MX records.

      For more information about priority, see What is MX priority?

    • If TTL is listed, use 3600 seconds or 1 hour.

  2. Save the record.

Verify your domain in Office 365.

Important   Wait a few minutes before you do this, so the record you just created can update across the Internet.

Go back to Office 365, and follow the steps below to request a verification check. The check looks for the TXT or MX record you added in the previous step. When it finds the correct TXT or MX record, the domain is verified.

  1. Sign in to Office 365 with your work or school account.

  2. Go to the Manage domains page.

  3. On the Manage domains page, in the Action column for the domain you are verifying, choose Start setup.

  4. On the Add this TXT record to show you ownyour_domain page, choose Okay, I've added the record.

Back to top

Add MX record to route email

Add an MX record so email for your domain will come to Office 365.

Task

Find the page where you can create records for your domain.

  1. Sign in to your DNS host’s website.

  2. Choose your domain.

  3. Find the page where you can edit DNS records for your domain.

The MX record you'll add includes a value (the Points to address value) that looks something like this: <MX token>.mail.protection.outlook.com, where <MX token> is a value like MSxxxxxxx.

  1. On your DNS host’s website, click to add a new MX record.

    Now you'll get the information for the MX record from Office 365.

  2. For the MX record (in the step above), copy the Points to address value.

    You'll use this value in the record you're creating on your DNS host's site, as described in the next step.

  3. In the new MX record on your DNS host's site, make sure that the fields are set to precisely the following values:

    • Record Type: MX

    • Priority: Set the priority of the MX record to the highest value available, which is typically 0.

      For more information about priority, see What is MX priority?

    • Host Name: @

    • Points to address: Paste the Points to address value that you just copied from Office 365 here.

    • TTL: Set this value to 1 hour or to the equivalent in minutes (60), seconds (3600), etc.

  4. Save the record.

Remove any other MX records.

If you have any MX records for this domain that send email to someplace other than Office 365, delete them all.

Back to top

Add four CNAME records

Follow the steps below to add the four CNAME records that are required for Office 365. If additional CNAME records are listed in Office 365, add those following the same general steps shown here.

  • On your DNS host’s website, you'll create four new CNAME records, typically one at a time.

  • In the boxes for each new record, type or copy and paste the following values. After you add each of the first three new records, choose to create another CNAME record.

    Record Type

    Host

    Points to

    TTL

    CNAME (Alias)

    autodiscover

    autodiscover.outlook.com

    1 hour

    CNAME (Alias)

    lyncdiscover

    webdir.online.lync.com

    1 hour

    CNAME (Alias)

    msoid

    clientconfig.microsoftonline-p.net

    1 hour

    CNAME (Alias)

    sip

    sipdir.online.lync.com

    1 hour

    Note   For TTL: Set this value to 1 hour or to the equivalent in minutes (60), seconds (3600), etc.

  • When you've finished, save the records.

Add two CNAME records for Multiple Device Manager (MDM)

Important   If you have Multiple Device Manager (MDM), then you must also create the following two CNAME records.

Record Type

Host

Points to

TTL

CNAME (Alias)

enterpriseregistration

enterpriseregistration.windows.net

1 hour

CNAME (Alias)

enterpriseenrollment

enterpriseenrollment.manage.microsoft.com

1 hour

Back to top

Add a TXT record for SPF to help prevent email spam

Follow the steps below.

  • On your DNS host’s website, create a new TXT record.

  • In the boxes for the new record, type or copy and paste the following values.

    Record Type

    Host

    TXT Value

    TTL

    TXT (Text)

    @

    v=spf1 include:spf.protection.outlook.com -all

    Note   We recommend copying and pasting this entry, so that all of the spacing stays correct.

    1 hour

    Note   For TTL: Set this value to 1 hour or to the equivalent in minutes (60), seconds (3600), etc.

  • When you've finished, save the record.

Back to top

Add two SRV records

Follow the steps below.

  • On your DNS host’s website, you'll create two new SRV records, typically one at a time.

  • In the boxes for each new records, type or copy and paste the following values. After you add the first new record, choose to create another SRV record.

    Record Type

    Name

    Target

    Protocol

    Service

    Priority

    Weight

    Port

    TTL

    SRV (Service)

    @

    sipdir.online.lync.com

    _tls

    _sip

    100

    1

    443

    1 hour

    SRV (Service)

    @

    sipfed.online.lync.com

    _tcp

    _sipfederationtls

    100

    1

    5061

    1 hour

    Notes   

    • For Name: If your DNS host doesn't allow setting this to @, leave it blank.

    • For TTL: Set this value to 1 hour or to the equivalent in minutes (60), seconds (3600), etc.

When you've finished, save the records.

Back to top

Note    Typically it takes about 15 minutes for DNS changes to take effect. However, it can occasionally take longer for a change you've made to update across the Internet's DNS system. If you’re having trouble with mail flow or other issues after adding DNS records, see Troubleshoot issues after changing your domain name or DNS records.

More about updating DNS records

If you know how to update DNS records at your domain's DNS host, use the Office 365 DNS values to edit records at your domain's DNS host, for example, to set up an MX record or SPF record. Find the specific values to use by following these steps, or view them in the domains setup wizard as you step through it.

If you need some help figuring out how to add the required DNS records and your DNS hosting provider is not listed in Create DNS records for Office 365, first gather the information you need to create Office 365 DNS records. Then use the following general steps to set up your DNS records with Office 365 services.

If you don't have a website that you use with your custom domain, you can have Office 365 set up and manage DNS records for your domain instead of doing all the setup yourself. Learn about the two options for setting up and managing DNS records for a custom domain in Office 365.

Still need help?

Get help from the Office 365 community forums Admins: Sign in and create a service request Admins: Call Support

Back to top

Applies To: Office 365 Admin, Office 365 Small Business Admin



Was this information helpful?

Yes No

How can we improve it?

255 characters remaining

To protect your privacy, please do not include contact information in your feedback. Review our privacy policy.

Thank you for your feedback!

Support resources

Change language