Created
September 21, 2013 20:47
-
-
Save brimston3/6654030 to your computer and use it in GitHub Desktop.
Awk script to convert from a list of IPv4s and hostnames to a zonefile format rdns entry.
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
awk '{print gensub(/([0-9]*)\.([0-9]*)\.([0-9]*)\.([0-9]*) - (.*)/,"\\4.\\3.\\2.\\1.in-addr.arpa. IN PTR \\5.", $0)}' << "EOF" | |
192.168.1.101 - test.localdomain | |
192.168.1.105 - test2.example.com | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Probably lower resource usage in sed, but awk is more familiar.