Skip to content

Instantly share code, notes, and snippets.

@TomK
Last active October 28, 2020 11:57
Show Gist options
  • Save TomK/0af679986733938115f4f1b6d5bee73f to your computer and use it in GitHub Desktop.
Save TomK/0af679986733938115f4f1b6d5bee73f to your computer and use it in GitHub Desktop.
bash script to get records from domain authority
#!/bin/bash
# get authoritiy
AUTHORITY=$(dig +noall +trace $1 NS | grep '\tNS\t' | tail -n1 | awk '{print $5}')
echo "AUTHORITY: $AUTHORITY"
Q=$1
shift
dig @$AUTHORITY ${@:-ANY} +noall +answer $Q
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment