Skip to content

Instantly share code, notes, and snippets.

@ihashacks
Created June 6, 2013 03:49
Show Gist options
  • Save ihashacks/5719180 to your computer and use it in GitHub Desktop.
Save ihashacks/5719180 to your computer and use it in GitHub Desktop.
misc IP and DNS stuffs
grep -v ^\; /var/named/chroot/var/named/db.example \|
awk ' { if($3 =="A") print $4 "\t" $1 ".example.com" } ' \|
sort -n -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4
sed -e '/^#/d' -e '/^\}/d' -e '/^$/d' dhcpd.leases \|
grep -Ev '^[[:space:]]*starts|ends|tstp|tsfp|atsfp|cltt|epoch|uid|client-hostname|abandoned|binding|boot' \|
awk ' /{/ { print "host " $2 " {\n\tfixed-address " $2 ";" } /\;/ { print "\thardware ethernet " $3 "\n}" } '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment