I had tried dbus-monitor but message sniffing was disabled on my system and it gave me no useful information.

I also considered tcpdump/wireshark to watch for outbound traffic on port 53 but I also wanted to know when queries were being resolved from cache, not just when they were resolved through external dns servers.

Syslog was exactly what I needed.

Thanks Pali!

-Joel

On 03/29/2017 10:11 AM, Pali Rohár wrote:
On Wednesday 29 March 2017 09:43:33 Joel Whitehouse wrote:
Both the file /var/run/NetworkManager/dnsmasq.conf and the directory
/etc/NetworkManager/dnsmasq.d/ are empty, so it's likely that dnsmasq is
receiving its resovlers from Network Manager over the dbus interface.

Right.

Is there any way to get dnsmasq to log when it issues a new query to a
resolver?

I have all information in syslog.

dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 21
dhclient: DHCPREQUEST of X.X.X.X on wlan0 to 255.255.255.255 port 67
dhclient: DHCPOFFER of X.X.X.X from X.X.X.X
dhclient: DHCPACK of X.X.X.X from X.X.X.X
dhclient: bound to X.X.X.X -- renewal in X seconds.
NetworkManager[1977]: <info> (wlan0): DHCPv4 state changed preinit -> bound
NetworkManager[1977]: <info>   address X.X.X.X
NetworkManager[1977]: <info>   prefix X (X.X.X.X)
NetworkManager[1977]: <info>   gateway X.X.X.X
NetworkManager[1977]: <info>   nameserver 'X.X.X.X'
NetworkManager[1977]: <info>   domain name 'X'
NetworkManager[1977]: <info> Activation (wlan0) Stage 5 of 5 (IPv4 Configure 
Commit) scheduled...
NetworkManager[1977]: <info> Activation (wlan0) Stage 5 of 5 (IPv4 Commit) 
started...
NetworkManager[1977]: <info> (wlan0): writing resolv.conf to /sbin/resolvconf
dnsmasq[4160]: setting upstream servers from DBus
dnsmasq[4160]: using nameserver X.X.X.X#53

So when NetworkManager via dbus reconfigure list of nameservers then
dnsmasq logs them into syslog.



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

Reply via email to