# DNS propagation and TTL explained

> DNS propagation is the delay while resolvers around the world keep serving a cached old answer until its TTL runs out.

URL: https://levelrail.com/learn/domains-https/dns-propagation-and-ttl/
Updated: 2026-11-27

You switch your domain to a new server, reload the site, and it still shows the old one. Your friend sees the new one. Neither of you did anything wrong. Different DNS caches simply hold different answers for a while, and understanding which cache holds what lets you plan a move with almost no visible gap.

## How it works

Every DNS record has a TTL (time to live), a number of seconds. When a resolver looks up your domain, it keeps the answer and reuses it until the TTL runs out. After that it asks again and gets the new value. So "propagation" is really many separate caches expiring at different moments.

Nothing is pushed out. The authoritative nameserver changes immediately. A resolver that cached the old answer one second before your edit holds it for nearly the whole TTL. A resolver that never asked before gets the new answer at once. That is why results look random.

Caches exist in layers: the resolver at your ISP or a public service, the operating system, and often the browser. Some software also keeps its own copy for the life of a process, so a long running app may need a restart.

Negative answers are cached too. If a resolver was told a name does not exist (`NXDOMAIN`), it may remember that for a period governed by the zone's SOA record (its negative caching value). So creating a record right after someone looked it up can still show as missing for a short time.

A longer TTL means fewer lookups but a slower change. A shorter TTL means faster changes at the cost of more queries.

## Step 1: See the current TTL

```bash
dig example.com A
```

In the ANSWER SECTION, the number after the name is the remaining TTL for that answer when it came from a cache. Ask the authoritative nameserver to see the full configured value (see the dig lesson for how to find it):

```bash
dig +noall +answer example.com A @ns1.example.net
```

What you should see: a line with the name, the TTL in seconds, `IN`, `A` and the address. Asked repeatedly through a resolver, the TTL counts down. Asked from the authoritative server, it stays at the configured value.

## Step 2: Lower the TTL ahead of a change

Before you move a site to a new server, edit the record at your DNS provider and set a low TTL, for example 300 seconds. Then wait at least as long as the old TTL, so caches holding the old long value have expired. Only then change the IP. After the move works, raise the TTL again.

What you should see: the authoritative answer from Step 1 now shows the lower TTL. Public resolvers show the new TTL only after their old cached copy expires.

## Step 3: Make the change

Update the A record to the new address and save it. If you also have an AAAA record, update or remove it too. Keep the old server running while caches drain.

## Step 4: Compare resolvers

```bash
dig +short example.com A @ns1.example.net
dig +short example.com A @1.1.1.1
dig +short example.com A @8.8.8.8
```

Use a nameserver name from `dig +short example.com NS`. What you should see: the authoritative answer shows the new IP immediately. Resolvers that still show the old IP have not refreshed yet.

## Check it worked

Repeat the three queries later. Once the cached TTL runs out, all of them match the new IP. Do not promise yourself or your users a fixed time, because it depends on each resolver and on the TTL that was in place before the change. When all answers agree, test the site itself, and flush your own cache if the browser still disagrees.

## Edge cases and gotchas

- **Lowering the TTL is not retroactive.** Caches that already hold the old value keep it for the old TTL. Lower the TTL, wait the old TTL, then change the record.
- **Some resolvers ignore very low TTLs or enforce a minimum.** You cannot rely on a one second TTL being honored everywhere. Plan for a short but not zero overlap.
- **Your own machine caches.** Your operating system and browser may hold the old answer. Test with `dig @1.1.1.1` first, and restart the browser if needed. On macOS you can flush with `sudo dscacheutil -flushcache`.
- **A changed nameserver is slower than a changed record.** Switching a domain to new nameservers at the registrar involves the parent zone's NS records, which have their own, usually longer, TTL.
- **A long running app keeps the old IP.** Some programs resolve a name once at start and never again. Restart them after a move.
- **Keep the old server alive during the move.** Visitors on cached answers still reach it. Shut it down only after traffic stops.
- **HTTPS can fail on the new server at first.** Certificate issuing often needs DNS to point at the new host first. Issue the certificate before the cutover where possible, or use DNS validation.

## Troubleshooting

| Symptom | Likely cause | Fix |
| --- | --- | --- |
| Authoritative shows new IP, a public resolver shows old | That resolver's cache has not expired | Wait out the TTL and query again |
| Authoritative still shows the old IP | Change not saved, or you edited a zone that is not authoritative | Check `dig +short example.com NS` and edit at that provider |
| `status: NXDOMAIN` right after creating the record | Name was queried before it existed, negative answer cached | Query the authoritative server, then wait for the negative cache to expire |
| Browser shows the old site, dig shows the new IP | OS or browser cache | Flush the OS cache, restart the browser |
| Some visitors reach the new server, some the old | Normal while caches expire | Keep both servers serving until it settles |
| Site works on IPv4, broken for some users | Stale AAAA record | Update or remove the AAAA record |
| `dig` against the authoritative server times out | Wrong server name or port 53 blocked | Re-read the name from `dig +short example.com NS` |
| Mail or other services still go to the old host | MX or other records not changed | Review every record type, not only A |

## Real-world scenario

You are moving a store from an old VPS (198.51.100.20) to a new one (203.0.113.10) on a Saturday night. On Thursday you lower the A record's TTL from a day to five minutes. You do nothing else, because caches that hold the old one-day value will keep it until it expires.

On Saturday evening you check the authoritative server:

```bash
dig +noall +answer example.com A @ns1.example.net
```

It shows TTL 300. By now every cache that ever saw the old record has expired. You change the address to 203.0.113.10, then run `dig +short example.com A @1.1.1.1` and `@8.8.8.8` every minute or two. Within a few minutes both show the new address. The old VPS keeps running for another day to catch stragglers on stale caches, and orders still arrive at it until you see no traffic in its access log.

On Sunday you set the TTL back to a longer value so resolvers ask less often. If the store had needed a quick return to the old server, you would have changed the record back, and the same short TTL would have made that fast too. The same idea shows up in [rollbacks](https://levelrail.com/learn/deploy-operate/rollbacks/)).

## Quick reference

```bash
dig +noall +answer example.com A @ns1.example.net   # authoritative, full TTL
dig +noall +answer example.com A @1.1.1.1           # public resolver, TTL counts down
dig +short example.com NS                           # who is authoritative
dig example.com SOA                                 # includes negative caching value
sudo dscacheutil -flushcache                        # macOS local cache
```

## Related lessons

- [Point a domain at your server](https://levelrail.com/learn/domains-https/point-a-domain-at-your-server/)): the record you are changing.
- [DNS record types explained](https://levelrail.com/learn/domains-https/dns-record-types-explained/)): which records carry a TTL and what they do.
- [HTTPS and Let's Encrypt](https://levelrail.com/learn/domains-https/https-and-lets-encrypt/)): why the certificate depends on DNS pointing right.

## Next

With DNS settled, set up the server side in [Nginx reverse proxy with certbot](https://levelrail.com/learn/domains-https/nginx-reverse-proxy-with-certbot/)).

## Frequently asked questions

### How long does DNS propagation take?

There is no fixed time. Each resolver refreshes when the TTL of its cached answer expires, so the delay depends on the TTL that was set before the change.

### Does DNS actually propagate?

Not as a push. Nothing is sent out. Your change is live on the authoritative nameserver at once, and other resolvers pick it up when they next ask.

### I lowered the TTL right now and then changed the IP. Why is it still slow?

Resolvers that cached the record earlier still hold it for the old, longer TTL. Lowering the TTL only helps once the old TTL has run out, so lower it and wait first.

### I created a new record but some places say the name does not exist. Why?

A resolver that asked before the record existed may have cached the NXDOMAIN answer. That negative answer is kept for a time set by the zone's SOA record, so it can linger briefly.
