Created
February 15, 2016 17:35
-
-
Save asergeyev/2c943caf3c72c4fa69e3 to your computer and use it in GitHub Desktop.
Bunch of dig command line examples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# All authority gluerecs by name: | |
dig +noall +authority $NAME @b.gtld-servers.net | sed -e 's/.*\s//' | xargs -n1 -I % bash -c 'dig +short $NAME @% | sed -e s/^/%\\t/' | |
# All authority gluerecs with glue IPs: | |
dig +noall +additional $NAME @b.gtld-servers.net | sed -e 's/.*\s//' | xargs -n1 -I % bash -c 'dig +short $NAME @% | sed -e s/^/%\\t/' | |
# All recs found with resolving every name to all known IPs | |
dig +noall +authority $NAME @b.gtld-servers.net | sed -e 's/.*\s//' | xargs -n1 -I % dig +short NS $ZONE @% | sort -u | xargs -n1 -I % bash -c 'dig +short A %; dig +short AAAA %' | sort -u | grep -v : |xargs -n1 -I % bash -c 'dig +short $NAME @% | sed -e s/^/%\\t/' | |
# For one above, find zone by name (not 100% good but works ok for basic things): | |
dig +noall +authority SOA _.c.b.a.$NAME |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment