Skip to content

Instantly share code, notes, and snippets.

@pawal
Last active March 1, 2016 15:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pawal/c0f50937063fbe44b454 to your computer and use it in GitHub Desktop.
Save pawal/c0f50937063fbe44b454 to your computer and use it in GitHub Desktop.
#!/bin/bash
# The file is a newline separated list of domains
# Output is the same list, but with all name servers listed
filename="$1"
while read -r line
do
name="$line"
echo -n "$name:"
output=$(dig +short ns $name)
for x in $output; do echo -n " $x"; done;
echo
done < "$filename"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment