Simon Kelley | 4c960fa | 2015-03-04 20:32:26 +0000 | [diff] [blame] | 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
|
Josh Soref | 730c674 | 2017-02-06 16:14:04 +0000 | [diff] [blame] | 3 | via dns. Other IP addresses are searched for in the dnsmasq query log.
|
Simon Kelley | 4c960fa | 2015-03-04 20:32:26 +0000 | [diff] [blame] | 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
|
Joachim Zobel | 47b9ac5 | 2015-02-23 21:38:11 +0000 | [diff] [blame] | 7 |
|
Simon Kelley | 4c960fa | 2015-03-04 20:32:26 +0000 | [diff] [blame] | 8 | netstat -n -4 | ./reverse_replace.sh
|
| 9 |
|
| 10 | to see what it does. It needs
|
Joachim Zobel | 47b9ac5 | 2015-02-23 21:38:11 +0000 | [diff] [blame] | 11 |
|
| 12 | log-queries
|
| 13 | log-facility=/var/log/dnsmasq.log
|
| 14 |
|
Simon Kelley | 4c960fa | 2015-03-04 20:32:26 +0000 | [diff] [blame] | 15 | in the dnsmasq configuration.
|
Joachim Zobel | 47b9ac5 | 2015-02-23 21:38:11 +0000 | [diff] [blame] | 16 |
|
Simon Kelley | 7ef5569 | 2019-04-08 17:17:07 +0100 | [diff] [blame] | 17 | The script runs on debian (with dash installed) and on busybox.
|
Joachim Zobel | 47b9ac5 | 2015-02-23 21:38:11 +0000 | [diff] [blame] | 18 |
|