blob: db9ca77b6bc1e4b371292cbd7e9e9ef93d9682ed [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
Josh Soref730c6742017-02-06 16:14:04 +00003via dns. Other IP addresses are searched for in the dnsmasq query log.
Simon Kelley4c960fa2015-03-04 20:32:26 +00004This 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 Kelley7ef55692019-04-08 17:17:07 +010017The script runs on debian (with dash installed) and on busybox.
Joachim Zobel47b9ac52015-02-23 21:38:11 +000018