Created
June 6, 2013 03:49
-
-
Save ihashacks/5719180 to your computer and use it in GitHub Desktop.
misc IP and DNS stuffs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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