[Dnsmasq-discuss] Finding actual DNS server used

Chris Green cl at isbd.net
Sun Jan 15 09:53:00 GMT 2017


On Sun, Jan 15, 2017 at 09:21:25AM +0100, Albert ARIBAUD wrote:
> Hi Chris,
> 
> Le Sat, 14 Jan 2017 19:27:28 +0000
> Chris Green <cl at isbd.net> a écrit:
> 
> (re getting dnsmasq to say which upstream servers it uses)
> 
> > Why is is so difficult to provide this information?  At the very least
> > it would provide a confidence check that all is working as intended.
> > It might very well help if something isn't working too.
> 
> It is not difficult at all to get this information. It's just that
> dnsmasq does not provide any "API" to get it, because it's easy to get
> it  otherwise for diagnosis purposes.
> 
> For diagnosis, the operator can:
> 
> - read the configuration file(s) dnsmasq uses and find "server="
>   lines in it, and read the /etc/resolv* tree, if dnsmasq uses them,
>   and that will give the list of servers dnmasq uses at any point in
>   time.
> 
There aren't any!  These are systems where dnsmasq is run by Network
Manager rather than directly, thus there is no spcific dnsmasq
configuration file.


> - log DNS queries, which will give the additional info about
>   which client actually queried dnsmasq, which queries were cached vs
>   sent upstream (to which server), and what the answer was.
> 
> - run tcpdump or wireshark on the dnsmasq host or on the DNS client (or
>   both for troubleshooting e.g. timing-related issues). This will give
>   a full view of DNS exchanges on the considerd machine, to the last
>   bit, litterally.
> 
> So, from a diagnosis point of view, pulling the actual list of servers
> from a running dnsmasq is not that much of a need.
> 
It would be a whole lot easier than the above though wouldn't it?

To 'log DNS queries' one may have to actually stop and start the
system and that may well make the problem one is trying to look at
disappear.

Both tcpdump and wireshark are quite esoteric utilities, it would take
quite a bit of knowledge of using them to extract the required
information.

Surely there's a case for something that simply lists the upstream DNS
servers that a dnsmasq instance is using.

-- 
Chris Green



More information about the Dnsmasq-discuss mailing list