Skip to content

Instantly share code, notes, and snippets.

@pawal
Created April 22, 2016 13:39
Show Gist options
  • Save pawal/df9444e30eb4d10af0bd1042c0966a4f to your computer and use it in GitHub Desktop.
Save pawal/df9444e30eb4d10af0bd1042c0966a4f to your computer and use it in GitHub Desktop.
Get a list of delegated domains from a zone
#!/bin/sh
awk '{
if (match($0,"^$")) # remove empty lines
skip = $1
else if (match($0,"^;")) # remove comment lines
skip = $1
else if ($1 == "se.") # remove our own zone
skip = $1
else if ($1 == "nu.") # remove our own zone
skip = $1
else if ($4 == "NS") # match on NS
print $1
}'|sort -u|sed 's/.$//'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment