# Azure DNS and Load Balancer

> Chapter 20 of the Courseiva AZ-900 curriculum — https://courseiva.com/learn/az-900/azure-dns-load-balancer

**Official objective:** 2.3 — Azure Architecture Services

## Introduction

This chapter covers two related Azure networking services — DNS and Load Balancer — that solve different but complementary problems. AZ-900 tests this under objective 2.3, alongside other networking topics.

## A Phone Book and a Traffic Officer

Imagine trying to call a business without a phone book — you'd need to already know their exact phone number. A phone book (or directory service) lets you look up a business by name and find the right number to dial. DNS works the same way for the internet: it translates human-friendly names (like a website address) into the numeric addresses computers actually use to connect. Separately, imagine a busy intersection with a traffic officer directing cars to whichever lane is least congested, so no single lane gets overwhelmed. A load balancer does the same thing for network traffic — directing incoming requests across multiple resources so no single one gets overwhelmed.

## Core explanation

### Azure DNS
Azure DNS is a hosting service for DNS domains, providing name resolution using Azure's infrastructure. DNS (Domain Name System) translates human-readable domain names into the IP addresses computers use to locate and connect to resources. Azure DNS lets organizations manage their domain's DNS records using the same tools and infrastructure as their other Azure resources.

### Azure Load Balancer
Azure Load Balancer distributes incoming network traffic across multiple resources (such as several virtual machines), improving both availability (if one resource fails, traffic goes to the others) and performance (no single resource is overwhelmed by all the traffic). It operates at the network level, distributing traffic based on factors like the resource's current load or a defined distribution rule.

### How they work together
DNS and load balancing solve different problems but often work together: DNS resolves a domain name to an IP address (which might be the address of a load balancer), and the load balancer then distributes the actual traffic across multiple backend resources. A user's request typically goes through DNS resolution first, then reaches a load balancer, which routes it to one of several available resources.

### Why both matter for availability and performance
Without DNS, users would need to remember numeric IP addresses instead of friendly domain names. Without a load balancer, all traffic would go to a single resource, creating both a performance bottleneck and a single point of failure.

## Real-world context

A company running a web application across multiple virtual machines uses Azure Load Balancer to distribute incoming traffic evenly across them, so no single VM becomes overwhelmed and the application keeps working even if one VM fails.

Separately, that same company uses Azure DNS to manage their domain, so their custom domain name resolves to the load balancer's address, letting users reach the application using a friendly domain name rather than a numeric IP address.

## Exam focus

Objective 2.3 expects candidates to understand what DNS and Load Balancer each do individually, and how they solve related but distinct problems.

A common wrong answer is confusing DNS with load balancing — DNS resolves domain names to IP addresses; load balancing distributes traffic across multiple resources once a request arrives. Another common trap is assuming a load balancer is only about performance — it also improves availability, since traffic can be redirected away from a failed resource.

Stable terms: **DNS**, **Load Balancer**. Understanding that DNS handles name resolution and load balancing handles traffic distribution, and that they're often used together, is the core exam-relevant distinction.

Memory trick: DNS answers "where is this address?" Load Balancer answers "which specific resource should handle this request right now?"

## Step by step

1. **Register and configure a domain in Azure DNS** — A domain's DNS records are hosted and managed in Azure DNS, allowing name resolution using Azure's infrastructure.
2. **Deploy multiple backend resources** — Multiple instances of a resource (such as several VMs running the same application) are deployed to distribute load across, rather than relying on a single instance.
3. **Configure a load balancer in front of them** — Azure Load Balancer is configured to distribute incoming traffic across those multiple backend resources.
4. **Point DNS to the load balancer** — A domain's DNS record is configured to resolve to the load balancer's address, so incoming requests are routed through it to the appropriate backend resource.

## Comparisons

### Azure DNS vs Azure Load Balancer

**Azure DNS:**
- Resolves domain names to IP addresses
- Handles name lookup, not traffic routing
- Used before a connection is established

**Azure Load Balancer:**
- Distributes traffic across multiple resources
- Handles routing of actual requests
- Used once traffic is already headed to a resource

## Common misconceptions

- **Misconception:** DNS and Load Balancer solve the same problem. **Reality:** DNS resolves domain names into IP addresses; a Load Balancer distributes traffic across multiple resources once a request has arrived. They're complementary, not interchangeable.
- **Misconception:** A load balancer is only about improving performance. **Reality:** Load balancing also improves availability — if one backend resource fails, the load balancer can direct traffic to the remaining healthy resources instead.
- **Misconception:** You need a load balancer to use DNS, or vice versa. **Reality:** They're independent services that are often used together, but each can be used without the other depending on the scenario — a single-server setup might use DNS without needing a load balancer, for example.

## Key takeaways

- Azure DNS hosts DNS domains and provides name resolution, translating domain names into IP addresses.
- Azure Load Balancer distributes incoming traffic across multiple resources, improving both availability and performance.
- DNS and load balancing solve different problems but often work together in a typical application architecture.
- A load balancer improves availability, not just performance, by routing traffic away from failed resources.

## FAQ

**What does Azure DNS do?**

It hosts DNS domains and provides name resolution — translating human-readable domain names into the IP addresses computers use to connect to resources — using Azure's infrastructure.

**What does Azure Load Balancer do?**

It distributes incoming network traffic across multiple resources (like several virtual machines), improving both performance (avoiding overload on a single resource) and availability (redirecting traffic away from a failed resource).

**Do I need both DNS and a Load Balancer?**

Not necessarily — they solve different problems and can be used independently. But they're commonly used together: DNS resolves a domain name to an address, which might point to a load balancer that then distributes traffic across multiple backend resources.

---

Interactive version with quiz and diagrams: https://courseiva.com/learn/az-900/azure-dns-load-balancer
