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: ~/.digrc stores the dig options you always type

Dig
~/tips/tip-dig-digrc-default-options

echo '+noall +answer' > ~/.digrc

Keeps your favourite dig options in a dotfile that is read on every run.

I type the same flags on nearly every dig call. A small dotfile saves them.

echo '+noall +answer' > ~/.digrc
dig example.com A
dig -r example.com A

dig reads $HOME/.digrc on startup and applies its options before the ones on the command line. With the file above, every query prints only the answer section. A flag typed later overrides the file, so dig +all example.com shows everything again, and -r skips the file completely, which is useful in scripts that need predictable output. A different server on the command line still works as usual.

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