Sign in

DNS basics

Domain names, like, are managed by using a worldwide system of domain registrars and databases. The Domain Name System (DNS) provides a mapping between human-readable computer hostnames and the IP addresses used by networking equipment. An understanding of DNS and domain registrar basics will help admins manage domains in Office 365 operated by 21Vianet.

What are domain names?

Understand DNS record types

What are domain names?

Domain names are used in URLs and email addresses, and they have different levels. For example, is a domain name with the following three levels:

  • . com is the top-level domain

  • contoso is the second-level domain

  • mail is the third-level domain

Why use a third-level domain? You might want to have different domain names for marketing or a blog. For example, In Office 365, third-level domains are available.

Understand DNS record types

DNS records are used to direct traffic to and from your domain. The following table describes frequently used DNS records and how they’re used with Office 365.

NS (name server) record

Identifies the name servers that are the “authoritative name servers” for a domain. When you change these servers, you change where your DNS records are managed and where the DNS system looks for information about mail servers and so on.

A record (address record)

Associates a domain name with an IP address.

CNAME (alias or canonical) record

Redirects one domain to another in the DNS system. When a name server looks up a domain and finds that it has a CNAME record, the server replaces the first domain name with the CNAME, and then looks up the new name.

MX (mail exchanger) record

Points to where your email should be sent. It also has a priority field so that you can send mail to different servers in a priority order.

SPF (sender policy framework) record

Helps prevent email spoofing and phishing.

SRV (service) record

Used by Skype for Business Online and Exchange Online to coordinate the flow of information between Office 365 services. For example, the SRV records are required to see presence in Outlook Web App, and to use Lync, Skype, or other instant messaging tools with people in other companies.

TTL (time-to-live)

The amount of time that a name server keeps a DNS record before the server looks for an updated version.

How does DNS work?

Part of setting up your domain with a cloud service like Office 365 includes changing or adding DNS records for the domain. These changes are required because of how the Internet works with the DNS, Domain Name System, and domain names, to know where to send or find things, like email and websites.

The Internet is set up to use DNS, or Domain Name System, which lets us use familiar names, like, to locate specific Internet locations that are actually, under the covers, labeled with hard-to-remember numbers called IP (Internet Protocol) addresses. IP addresses look something like, so you can see it’s much easier to use a domain name to identify locations like email hosts and websites.

So that's the short answer: DNS records tell the Internet where to send email (like or find websites (like that use your domain name. When you put the right information into the right DNS records for your domain, the DNS system routes everything correctly so your email, for example, arrives in Office 365 instead of somewhere else.

A domain's DNS records can be helpful in other ways, too. For example, Exchange checks a DNS record that lets Outlook automatically set up a connection to the right Exchange server.

DNS records help the Internet send email to the right place

As you read above, DNS essentially directs traffic around the Internet, mapping friendly domain names to those hard-to-remember IP addresses. One DNS record, called the MX record, is specifically for sending email to the right host.

DNS records are like a database of information about your domain. The records and their values are kept in something called a zone file, which includes a list of each record for your domain and what its value is. Domain registrars and other DNS hosting companies provide a UI on their websites so you can edit the records in your domain's zone file. And that’s where you update the MX record for your domain, to send email messages to Office 365.

Sound complicated? Well, it can be, but we walk you through each step in the Office 365 domain setup.

DNS tells the Internet where to look for websites too

When you type in a website address, for example,, the Internet first checks with one of the DNS servers for something called a name server (NS) record for (in this case) The NS record tells the Internet where it should look for the zone file that has all the other DNS record values for that domain. There are lots of DNS servers, all connected to each other. The servers work together to keep track of all registered domain names, which have to be unique, and where the domain’s zone files are.

Let's say that the NS record for says "" Now the Internet knows that is where to look for the zone file listing all the other DNS records for Those DNS records include the MX record that says where to send emails for and other records. If the MX record has a value that says (but in technical terms) "send email to Office 365," that's where all the email messages sent to a email address (like will be sent. Then, as long as there’s a mailbox called “joe” at that location, the email will be delivered.

The actual values that you must enter for all of this to work with Office 365 are listed for you when you're setting up your domain, in the domain setup steps. If you're doing the set up manually, you copy and paste the values into the correct DNS records (MX record, CNAME records, and so on) at your DNS host, which might be your domain registrar but doesn't have to be.

Why might your domain’s zone file be somewhere besides at your domain registrar? Well, you might register your domain name at a domain registrar like HiChina, but your DNS records might be managed somewhere else, at a separate DNS hosting company or a web hosting company. The NS records for your domain store that information so all the DNS servers know where to look.

Note:  If you set up your domain in Office 365 so that Office 365 sets up and manages your DNS records for you, as part of setup, you’ll set your domain’s NS records to point to Office 365 name servers.

The DNS records required for Office 365

There are a number of DNS records required for Office 365 to work with your domain. In addition to setting up your domain’s MX record so email will be sent to Office 365, there are records to help with tasks like making sure Outlook can connect to the right Exchange server, setting up Lync, and helping to prevent spam email.

You can find a list of values for your domains right in the Office 365 portal.

Expand your Office skills
Explore training
Get new features first
Join Office Insiders

Was this information helpful?

Thank you for your feedback!

Thank you for your feedback! It sounds like it might be helpful to connect you to one of our Office support agents.