Host your Office 365 DNS records in Azure DNS

Page content

I have noticed that not every domain register can add every DNS record that is needed for Office 365. This leaves you with two options, move your domain to another register or host your DNS records somewhere else. To host your DNS records in Azure DNS, you need to be able to update your NS records at your domain register. If that is not an option, you need to move the domain to another register.

Getting started

To set up the basics, follow this instruction from Microsoft https://docs.microsoft.com/en-us/azure/dns/dns-getstarted-portal This will give you a DNS zone for your domain. Now that you have this you can point your domain to the DNS zone’s nameservers. You get four nameservers that you can point to, put as many as your domain register allows in your domain registers back office.

Add extra DNS-records

Now that you have created the DNS-zone and pointed your domain to this DNS-zone you can add all the records you need. The first record we need for Office 365 is the TXT record to verify your domain.

You need to do this for every record you want in your domain.

Zone file

In Office 365 you can download a zone file. This file contains all DNS records you need for Office 365, and you can upload that file to Azure DNS. The zone file from Office 365 only contains the records that are needed. The import file needs to contain every record for this zone. So, you need to export the current settings and add the extra records to this file before importing it.

To do this save the zone file to your computer and open a command prompt. You need the Azure CLI for this (https://docs.microsoft.com/en-us/cli/azure/install-azure-cli)

Download the zone file from Azure with this command.

Open this file and copy everything from the zone file you downloaded from office 365 in this file.

Import this new file with

Now you can verify the DNS settings of your domain in Office 365.

Resources

https://docs.microsoft.com/en-us/azure/dns/private-dns-getstarted-cli https://docs.microsoft.com/en-us/azure/dns/dns-import-export https://docs.microsoft.com/en-us/cli/azure/install-azure-cli