Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to log requester IP? #48

Closed
sergiopvilar opened this issue Sep 28, 2015 · 4 comments
Closed

How to log requester IP? #48

sergiopvilar opened this issue Sep 28, 2015 · 4 comments

Comments

@sergiopvilar
Copy link

Hello,

I was taking a look through the dnsmasq documentation and I would like to log the rquester IP using the --log-queries=extra option as described:

-q, --log-queries
Log the results of DNS queries handled by dnsmasq. Enable a full cache dump on receipt of SIGUSR1. If the argument "extra" is supplied, ie --log-queries=extra then the log has extra information at the start of each line. This consists of a serial number which ties together the log lines associated with an individual query, and the IP address of the requestor.

But when I change my /etc/dnsmasq.conf to this:

addn-hosts=/etc/pihole/gravity.list
domain-needed
bogus-priv
no-resolv
server=8.8.8.8
server=8.8.4.4
interface=eth0
listen-address=127.0.0.1
cache-size=10000
log-queries=extra
log-facility=/var/log/pihole.log
local-ttl=300

And I try to restart using sudo service dnsmasq restart, I get this:

[FAIL] Restarting DNS forwarder and DHCP server: configuration syntax check failed!

Any thoughts that could help me here?

Thank you!

@jofrep
Copy link
Contributor

jofrep commented Sep 28, 2015

Hi Sergio,
I confirm the same error in both a raspberry (dnsmasq 2.62) and in an ubuntu server (dnsmasq 2.52)

I suspect the "extra" facility is only available in the latest dnsmasq version (version 2.75) because the man page in the RPi doesn't show this option.

Jofre

@sergiopvilar
Copy link
Author

Indeed @jofrep. I've installed the 2.75 release manually and now seems to be working.

Would be great if pi-hole could install the latest version of dnsmasq.

@jacobsalmela
Copy link
Contributor

Curious, what sort of extra information is provided? Could you show a snippet of the log?

@sergiopvilar
Copy link
Author

@jacobsalmela just now I've realized that the default log shows the requester IP, closing here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants