Lesson 1 of 4 Name Resolution and Load Balancing in Azure

Hosting Public Domains in Azure DNS

This lesson explains public DNS zones, delegation, record sets and alias records.

Learning outcomes

After completing this lesson, you will be able to:

  • Explain how a domain is delegated to Azure DNS.
  • Identify DNS record types and their uses.
  • Describe alias records and when to use them.

Zones and delegation

A DNS zone holds the records for one domain, such as contoso.com. Creating a public zone in a resource group gives it four Azure name servers, such as ns1-04.azure-dns.com, listed in the zone's NS record. Azure DNS does not register domain names; the domain is bought from a registrar (or as an App Service domain). To make Azure DNS authoritative, the domain must be delegated: at the registrar, replace the domain's name servers with the four Azure name servers.

A child zone, such as dev.contoso.com, can be hosted as a separate Azure DNS zone, for example managed by another team. It is delegated by adding an NS record set named dev in the parent zone containing the child zone's name servers. nslookup -type=SOA contoso.com confirms that delegation works.

The following diagram shows the missing delegation step that keeps a new Azure DNS zone from answering, and the apex record.

Why lookups still return old values after creating the Azure DNS zone. The domain has not been delegated: the name server records at the registrar must change to the four Azure DNS name servers shown on the zone. The apex then uses an alias A record at @ pointing to the load balancer's public IP resource, which follows address changes.
The scenario is illustrative.
Put in order

Hosting a domain in Azure DNS

Exam skills 4.3.1

Arrange the steps to make Azure DNS authoritative for contoso.com and delegate dev.contoso.com to another team.

Log in to try this activity Interactive activities are free with an account.

Record sets

Records are managed as record sets: all records with the same name and type, with one TTL. Azure DNS supports the record types below.

TypePurposeExample
A / AAAAName to IPv4 / IPv6 addresswww to 20.50.10.4
CNAMEAlias of another name (not at the apex, one record per set)shop to contoso-shop.azurewebsites.net
MXMail servers with preference@ to contoso-com.mail.protection.outlook.com
TXTText, such as domain verification or SPFasuid.www with a verification ID
NSName servers; delegation of child zonesdev to the child zone's name servers
SRVService location with port and priority_sip._tcp
CAACertificate authorities allowed to issue certificates@ 0 issue "digicert.com"
PTRReverse lookup (in reverse zones)4.10.50.20.in-addr.arpa

Alias records are A, AAAA or CNAME record sets that point to an Azure resource, such as a public IP address, a Traffic Manager profile, an Azure Front Door endpoint, or another record set in the zone, instead of a fixed value. They update automatically when the resource's address changes, are removed when the resource is deleted (preventing dangling records), and allow the zone apex to point to a resource where a CNAME is not allowed.

Match the pairs

Which record type?

Exam skills 4.3.1

Match each requirement with the DNS record type that meets it.

Log in to try this activity Interactive activities are free with an account.

Managing zones

Zones and records are managed in the portal, with az network dns record-set a add-record and similar commands, PowerShell, or templates. Azure RBAC controls who can change them, with roles such as DNS Zone Contributor, and assignments can be scoped to a single record set. Resource locks protect zones from deletion, and zone files can be imported and exported with the Azure CLI. DNSSEC signing is supported for public zones.

Scenario questions

Managing zones safely

Exam skills 4.3.1

Choose how to delegate and protect DNS management.

Log in to try this activity Interactive activities are free with an account.
Worked example

Moving a domain to Azure DNS

Contoso registered contoso.com with a third-party registrar, which also hosts its DNS. The company creates the zone contoso.com in Azure DNS and adds all records, but external lookups still return the old values. The apex must point to a public IP of a load balancer and follow it if it changes. What is missing?

The domain has not been delegated: change the name server records at the registrar to the four Azure DNS name servers shown on the zone. For the apex, create an alias A record at @ pointing to the public IP resource, which follows address changes; a CNAME at the apex is not allowed. Adding NS records inside the Azure zone does not change delegation, which is controlled by the parent zone.

Check yourself

Can Azure DNS register a new domain name?

Show answer

No. Azure DNS hosts zones; domains are registered with a registrar or bought as App Service domains.

Exam Tips

Remember for the exam

  • Azure DNS hosts zones; it does not register domains.
  • Delegate by setting the registrar's name servers to the four Azure name servers.
  • Child zones are delegated with an NS record set in the parent zone.
  • Alias records point the apex to Azure resources and follow address changes.