# How DNS Works – Step by Step

DNS resolution transforms a human-readable domain name into actionable network information — typically an IP address.\
Understanding how each stage of this process works helps Medianova users design fault-tolerant systems, debug DNS-related errors, and ensure reliable content delivery.\
Within **Medianova’s DNS and CDN infrastructure**, this resolution flow is optimized through [**Anycast routing**](https://clients.medianova.com/products/dns/dns-vs-dynamic-dns-vs-anycast-dns), [**caching policies**](https://clients.medianova.com/products/performance-cdn/static-content-delivery/advanced-configuration/caching), a for consistent global performance.

#### **Resolution Lifecycle Example**

Let’s examine how a request for `www.example.com` is resolved, step by step.

{% stepper %}
{% step %}

### Check Local DNS Cache

The client (browser or operating system) first checks its **local DNS cache** for a recent record.\
If a valid cached entry exists within its TTL, no external query is needed — resolution completes instantly.
{% endstep %}

{% step %}

### Send Query to Recursive Resolver

If no local record is found, the client forwards the query to a **recursive resolver** (e.g., an ISP resolver or a public DNS service such as `8.8.8.8` or `1.1.1.1`).\
The recursive resolver becomes responsible for retrieving the final authoritative answer.
{% endstep %}

{% step %}

### Query the Root Server

The resolver starts at the **root zone**, asking which nameservers are responsible for the requested **Top-Level Domain (TLD)**.\
Example query:

```css
Q: What are the authoritative nameservers for .com?
```

The root server responds with a referral to the corresponding TLD nameservers.
{% endstep %}

{% step %}

### Query the TLD Nameserver

The resolver queries one of the TLD nameservers to locate the authoritative nameservers for the target domain (`example.com`).

```css
Q: What are the authoritative nameservers for example.com?
```

The TLD server responds with a referral to the domain’s authoritative nameservers.
{% endstep %}

{% step %}

### Query the Authoritative Nameserver

The resolver sends a query to the authoritative nameserver for `example.com`, asking for the final record (e.g., **A**, **AAAA**, or **CNAME**) for `www.example.com`.

```
Q: What is the A record for www.example.com?
A = 93.184.216.34
```

This is the authoritative answer.
{% endstep %}

{% step %}

### Return and Cache the Response

The recursive resolver returns the final IP address to the client.\
Both the resolver and the client cache the response for the TTL duration, improving performance for future requests.
{% endstep %}
{% endstepper %}

### **DNS Resolution in the Medianova Platform**

In **Medianova’s architecture**, DNS resolution is tightly integrated with CDN and Redirect systems.

* **Anycast DNS** routes each query to the nearest available authoritative node for optimal response time.
* **CNAME records** map your branded domain (e.g., `cdn.yourdomain.com`) to the assigned Medianova CDN hostname (e.g., `yourzonename.mncdn.com`).
* **Redirect zones** leverage DNS resolution to manage domain-level forwarding.
* **Low TTL configuration** minimizes propagation delays during record updates.

For details on DNS configuration, see [Medianova DNS Service](https://clients.medianova.com/products/dns/medianova-dns-service) and [CNAME & SSL](https://clients.medianova.com/products/performance-cdn/static-content-delivery/advanced-configuration/cname-and-ssl).

### **Summary Table**

<table><thead><tr><th width="221.00006103515625">Stage</th><th>Description</th><th>Optimization in Medianova DNS</th></tr></thead><tbody><tr><td>Local cache</td><td>Client-side lookup before network query</td><td>Reduces repeated requests</td></tr><tr><td>Recursive resolver</td><td>Retrieves authoritative data</td><td>Anycast routing for low latency</td></tr><tr><td>Root &#x26; TLD queries</td><td>Navigate domain hierarchy</td><td>Global redundancy and caching</td></tr><tr><td>Authoritative nameserver</td><td>Provides final answer</td><td>Zone-based management for CDN &#x26; Redirect</td></tr><tr><td>Response caching</td><td>TTL-based storage</td><td>Configurable TTL values for fast propagation</td></tr></tbody></table>
