A friend of mine recently asked to provide a simple way to generate reverse DNS from a list of IP (v4 and v6), host, and a given domain.
School courses and projects were very boring, so I decided to deal with this request.
The script is written in Python.
The usage is as follow :
usage: reverse.py [-h] [-v] [-r] [-f] [-d DOMAIN] Generate Reverse RR & Forward RR from ipv4/ipv6 & host list optional arguments: -h, --help show this help message and exit -v, --version Show the version -r, --reverserr Only output the Reverse RR -f, --forwardrr Only output the Forward RR -d DOMAIN, --domain DOMAIN Change the domain (Default : example.org)
For example, to generate only Reverse RR for the domain fr33tux.org :
python reverse.py -r -d fr33tux.org
Will ask you to enter the list of IPs and hosts associated :
Please C/C your IP / host list below: 18.104.22.168 ns0
The generated output :
;REVERSE RR 22.214.171.124.in-addr.arpa. IN PTR ns0.fr33tux.org.
You can also use the stdin to fill the buffer with a file containing your list :
cat my_list | python reverse.py -f -r
Feel free to adapt them and submit your patches :)