Back to lessons

Web Server Rescue

Show the DNS Answer TTL

You need to see how long a DNS answer can remain cached.

Command

dig +noall +answer edge.test A

What changed

Nothing changes. The command prints the answer section including TTL.

Danger

safe

When to use it

Use during DNS cutovers or when deciding whether stale answers are expected.

When not to use it

Do not treat the displayed TTL as the original zone TTL after a resolver has already cached it.

Undo or recovery

No undo needed because this command is read-only.

Expected output

A DNS answer line showing name, TTL, class, type, and value.

demo script

Disposable terminal steps

  1. dig +short edge.test A
  2. dig +noall +answer edge.test A

simulated output

What it looks like

disposable vessel
::fixture-ready::
$ dig +short edge.test A
203.0.113.10
::exit-code::0
$ dig +noall +answer edge.test A
edge.test. 300 IN A 203.0.113.10
::exit-code::0

YouTube Short

Read the DNS TTL.

The answer can be right and still take time to reach users. The TTL tells you why.

LinkedIn hook

The fix was correct. The TTL explained why users still saw the old edge.

Question: Do you check TTL before calling a DNS cutover broken?

experiments

A/B tests to run

Metric: save_rate

A: The TTL explained the delay.

B: Print the answer section.