1 The script reads stdin and replaces all IP addresses with names before
2 outputting it again. IPs from private networks are reverse looked up
3 via dns. Other IP adresses are searched for in the dnsmasq query log.
4 This gives names (CNAMEs if I understand DNS correctly) that are closer
5 to the name the client originally asked for then the names obtained by
6 reverse lookup. Just run
8 netstat -n -4 | ./reverse_replace.sh
10 to see what it does. It needs
13 log-facility=/var/log/dnsmasq.log
15 in the dnsmasq configuration.
17 The script runs on debian (with ash installed) and on busybox.