blob: 2ec4df1f957ed8b4ac41035c4cacad60a45fb6f1 [file] [log] [blame]
Simon Kelley4c960fa2015-03-04 20:32:26 +00001The script reads stdin and replaces all IP addresses with names before
2outputting it again. IPs from private networks are reverse looked up
3via dns. Other IP adresses are searched for in the dnsmasq query log.
4This gives names (CNAMEs if I understand DNS correctly) that are closer
5to the name the client originally asked for then the names obtained by
6reverse lookup. Just run
Joachim Zobel47b9ac52015-02-23 21:38:11 +00007
Simon Kelley4c960fa2015-03-04 20:32:26 +00008netstat -n -4 | ./reverse_replace.sh
9
10to see what it does. It needs
Joachim Zobel47b9ac52015-02-23 21:38:11 +000011
12log-queries
13log-facility=/var/log/dnsmasq.log
14
Simon Kelley4c960fa2015-03-04 20:32:26 +000015in the dnsmasq configuration.
Joachim Zobel47b9ac52015-02-23 21:38:11 +000016
Simon Kelley4c960fa2015-03-04 20:32:26 +000017The script runs on debian (with ash installed) and on busybox.
Joachim Zobel47b9ac52015-02-23 21:38:11 +000018