Skip to content

Instantly share code, notes, and snippets.

@vitalvas
Created February 4, 2022 22:38
Show Gist options
  • Save vitalvas/1c20c0e8f994088660a479523b0d64da to your computer and use it in GitHub Desktop.
Save vitalvas/1c20c0e8f994088660a479523b0d64da to your computer and use it in GitHub Desktop.
#!/bin/bash
[ -z "${1}" ] && {
echo "No Server address"
exit 1
}
SERVER=${1}
NAMES=(authors.bind. version.bind. version.server. hostname.bind. id.server.)
for name in ${NAMES[*]}; do
echo -n -e "${name}: "
res=$(dig +short CHAOS TXT ${name} @${SERVER})
if [ -z "${res}" ]; then
echo "-"
else
echo "${res}"
fi
done
echo -n -e "NSID: "
dig +nsid example.com @${SERVER} | awk '$0~"NSID" {print $NF}' | tr -d '(")'
echo ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment