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: dig +norecurse checks what a resolver already has cached

Dig
~/tips/tip-dig-norecurse-cache-check

dig @192.168.1.1 example.com +norecurse

Asks a resolver for cached data only, without letting it query upstream.

Sometimes I want to know whether a resolver has an answer in its cache, without making it go out and fetch one.

dig @192.168.1.1 example.com +norecurse

+norecurse clears the RD (recursion desired) flag. A resolver that has the record cached still answers, and one that does not usually returns an empty answer or a refusal. Run this check before a normal lookup of the same name, because the normal lookup fills the cache and hides what you wanted to see. Some resolvers refuse non-recursive queries from clients on purpose, and that is expected.

Further reading: dig manual page

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