Am Montag, den 23.02.2015, 21:39 +0000 schrieb Simon Kelley:
> Thanks for that. I added the scripts to the /contrib directory of the
> source distribution. I hope that's OK.

Yes, but better use the attached script. It is only one script now.

I summarize:

The script reads stdin and replaces all IP addresses with names before
outputting it again. IPs from private networks are reverse looked  up
via dns. Other IP adresses are searched for in the dnsmasq query log.
This gives names (CNAMEs if I understand DNS correctly) that are closer
to the name the client originally asked for then the names obtained by
reverse lookup. Just run

netstat -n -4 | ./reverse_replace.sh 

to see what it does. It needs 

log-queries
log-facility=/var/log/dnsmasq.log

in the dnsmasq configuration.

The script runs on debian (with ash installed) and on busybox.

A future version will use log-queries=extra to look up the name the
client actually asked for.

Sincerely,
Joachim

Attachment: reverse_replace.sh
Description: application/shellscript

_______________________________________________
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss

Reply via email to