== A pyramid of little scripts: _nsdig_ One of my DNS diagnostic tools is a program called _nsdig_; it makes a query to all of the authoritative servers for a zone. This makes it convenient to both look for inconsistencies and see what the authoritative servers are saying, as opposed to whatever is filtering through your local caching servers. As another one of my [[little shell scripts LittleScriptsIII]], and as a practical example of how little utilities stack on top of each other to everyone's benefit, here's _nsdig_ and its component bits: ; cat nsdig #!/bin/sh case "$#" in 3) nssrc=$3;; 2) nssrc=$2;; *) echo usage: nsdig T WHAT [DOM] 1>&2 exit 1;; esac for i in `nsaddrs $nssrc`; do echo "---- $i ----" dig +norecurse $1 $2 @$i done (The third argument is necessary for cases like '_nsdig a www.foo.com foo.com_'.) ; cat nsaddrs #!/bin/sh addr `sdig ns $1` | sort -u ; cat addr #!/bin/sh for i in "$@"; do sdig a $i done ; cat sdig #!/bin/sh exec dig +short "$@" (_dig_ is the standard DNS lookup utility. Honesty compels me to admit that the version of _addr_ that I actually use is a much more complicated Python program with various additional features that are irrelevant for _nsaddr_'s usage.) The one building block that is not as useful as it could be is _dig_, which sometimes insists on sprinkling its output with extraneous bits. (For example, even the short _dig_ output for _TXT_ queries has quotes around the results, which are almost always surplus.)