Implement and Manage Virtual Networking · Topic 3 of 3

Azure DNS and Load Balancing

AZ-104 DNS and load balancing: public and private DNS zones, record types and alias records, Azure Load Balancer parts, Application Gateway and troubleshooting.

  • 5 min
In a nutshell
  • Public zones need delegation at the registrar. Private zones work only in linked VNets, with optional auto registration.
  • A CNAME cannot sit at the root of a domain. An alias record can.
  • Load Balancer is layer 4. Application Gateway is layer 7 with path routing, TLS and a firewall.

What it is

Azure DNS turns names into addresses, and load balancers spread traffic across machines that can handle it. The exam asks you to configure zones and records, build a load balancer from its parts, and fix one that is not working.

Usertypes a nameAzure DNSreturns an addressLoad balancerpicks a healthy backendVManswers

How it works

Azure DNS zones

A DNS zone hosts the records for one domain.

  • A public zone answers queries from the internet. To use it, you set the Azure name servers shown on the zone at your domain registrar. This is called delegation.
  • A private zone answers queries only inside virtual networks that are linked to it. A link can also have auto registration, which creates records for VMs in the network automatically.

Azure supplies a built in resolver at 168.63.129.16. You can also give a VNet your own DNS servers.

Records

TypeMaps
A and AAAAA name to an IPv4 or IPv6 address
CNAMEA name to another name
MXA domain to its mail servers
TXTText, used for verification
NS and SOAThe zone's name servers and authority

A CNAME cannot be used at the root of a domain. An alias record can. An alias record points to an Azure resource, such as a public IP address, a Traffic Manager profile or a Front Door profile, and updates by itself when the address changes.

Azure Load Balancer

Azure Load Balancer works at layer 4, with TCP and UDP. Use the Standard SKU. The Basic SKU has been retired. It can be public, with a public frontend, or internal, with a private frontend inside a VNet.

Its parts are:

  • Frontend IP configuration: the address clients use.
  • Backend pool: the machines that receive the traffic.
  • Health probe: checks each backend over TCP, HTTP or HTTPS. A backend that fails the probe stops receiving traffic.
  • Load balancing rule: maps a frontend address and port to the backend pool and port.
  • Inbound NAT rule: sends a specific port on the frontend to one machine, for example RDP.
  • Session persistence: by default requests are spread by a hash of the connection details. You can instead keep a client on one backend, using client IP, or client IP and protocol.

A Standard load balancer is secure by default, so an NSG must allow the traffic to the backends.

Application Gateway

Application Gateway works at layer 7, with HTTP and HTTPS. It can route by URL path or host name, end TLS connections and add a web application firewall. Use it when routing depends on the content of the request, and use Load Balancer for plain TCP or UDP traffic.

Troubleshooting load balancing

SymptomLikely cause
Backend shows unhealthyThe probe port or path is wrong, the app is not listening, or an NSG blocks the AzureLoadBalancer service tag
Clients cannot connectNo rule for the port, an NSG blocks the traffic, or the backend pool is empty
One backend gets no trafficIt fails the probe, or session persistence is keeping clients elsewhere

The load balancer metrics, such as health probe status and data path availability, show which part is failing.

Clientpublic IPFrontendrule on port 443Backend poolVM1 and VM2Health proberemoves failed VMs

Creating a public DNS zone

Putting a domain in Azure DNS has four steps.

  1. Create a DNS zone with the domain name.
  2. Add the records, such as an A record for www.
  3. Copy the four name servers shown on the zone.
  4. At the domain registrar, change the domain's name servers to those four. This is called delegation.

Until delegation, the records exist in Azure but the internet does not use them.

Private zones

A private zone is linked to one or more virtual networks. A link with auto registration creates and removes DNS records for VMs in the network automatically. A link without it only resolves names. Each virtual network can have one auto registration link, but can be linked to other zones for resolution.

Load balancer or application gateway

Azure Load BalancerApplication Gateway
Layer4, TCP and UDP7, HTTP and HTTPS
Routing byAddress and portURL path or host name
ExtrasZone redundancy, outbound rulesTLS termination, web application firewall

Health probes

A probe can use TCP, HTTP or HTTPS. A TCP probe only checks that the port answers. An HTTP or HTTPS probe requests a path and expects a successful response, so it also proves that the application works. If a probe fails, the backend is removed from rotation until it passes again.

How the exam asks about this

  • "Route by URL path." Application Gateway.
  • "Balance TCP traffic across VMs." Azure Load Balancer.
  • "Point the root of a domain to an Azure IP." An alias record.
  • "Create DNS records for VMs automatically." Auto registration on a private zone link.
  • "Backends all show unhealthy." Check the probe port, the app, and the AzureLoadBalancer rule in the NSG.

What to remember for the exam

  • Public zones need delegation at the registrar. Private zones work only in linked VNets, with optional auto registration.
  • A CNAME cannot sit at the root of a domain. An alias record can.
  • Load Balancer is layer 4. Application Gateway is layer 7 with path routing, TLS and a firewall.
  • Use the Standard SKU. It needs an NSG to allow inbound traffic.
  • A load balancer has a frontend, backend pool, health probe and rules.
  • A failed probe removes a backend from rotation. Check that the NSG allows the AzureLoadBalancer tag.
Exam tip

"Route by URL path" points to Application Gateway. "Balance plain TCP traffic" points to Azure Load Balancer.

Common mistakes

Creating a CNAME at the domain root. Use an alias record.

Forgetting delegation. Records in a public zone are not seen until the registrar uses the Azure name servers.

Blocking the health probe with an NSG. Every backend then looks unhealthy.

Choosing Load Balancer for URL routing. It cannot read the request path.

Check yourself

  • Which record type can point the root of a domain to an Azure public IP?

    An alias record.

  • At which layer does Azure Load Balancer work?

    Layer 4, for TCP and UDP.

  • Which service tag must an NSG allow so that load balancer probes can reach the backends?

    AzureLoadBalancer.

Topic 3 of 3 in Implement and Manage Virtual Networking

Test yourself on Implement and Manage Virtual Networking

The full Microsoft AZ-104 question bank has 650 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by Microsoft. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.