brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: the aa flag in dig shows whether you asked the real name server

Dig
~/tips/tip-dig-aa-flag-authoritative

dig +short NS example.com

Tell an authoritative answer from a cached one by reading the flags line.

After changing a record, I want to see what the domain’s own name server says, not what some cache remembers. The flags line in dig’s output tells you which one you got.

dig +short NS example.com
dig example.com @a.iana-servers.net | grep flags
dig example.com @9.9.9.9 | grep flags

The first command lists the name servers for the domain. Ask one of them directly and the flags include aa, authoritative answer: flags: qr aa rd. That is the zone’s real, current content. Ask a public resolver and you see qr rd ra without aa, which means the answer may come from a cache and can be up to one TTL old.

So when a change does not show up, query the authoritative server first. If aa is there and the new value is too, the zone is right and you only wait for caches. If the old value is still there with aa, the change never reached the zone.

The ra flag is worth a look too. An authoritative server that also says ra offers recursion to everyone, which is usually a misconfiguration. Some providers answer with aa from a whole fleet of servers, and right after a change not every one of them may be updated yet. If answers flip between runs, compare the SOA serial on each server.

Further reading: dig manual (BIND 9), RFC 1035: domain names, implementation

Going deeper: Guide: dig for beginners, look up DNS records and read the answer

More Dig tips dig +noall +answer DS example.com dig nope.iana.org @9.9.9.9 | grep -E 'status|SOA' dig +search nas dig @8.8.8.8 www.google.com +subnet=203.0.113.0/24 dig +yaml example.com A All Dig tips (36) All topics

Link