[Dnsmasq-discuss] Finding actual DNS server used
albert.aribaud at free.fr
Sun Jan 15 15:54:11 GMT 2017
Le Sun, 15 Jan 2017 12:36:47 +0000
Chris Green <cl at isbd.net> a écrit:
> On Sun, Jan 15, 2017 at 12:14:42PM +0100, Albert ARIBAUD wrote:
> > > > - 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.
> > ... and then the configuration is known from the dnsmasq process
> > command line. So let me amend my statement above: "... read the
> > configuration options, from the dnsmasq process command line if it
> > contains any, and from the configuration file or files if
> > applicable".
> chris at t430$ ps -ef | grep dnsmasq
> nobody 1579 1031 0 Jan14 ? 00:00:01 /usr/sbin/dnsmasq
> --no-resolv --keep-in-foreground --no-hosts --bind-interfaces
> --listen-address=127.0.1.1 --cache-size=0 --conf-file=/dev/null
> --conf-dir=/etc/NetworkManager/dnsmasq.d chris at t430$
> ... and there's nothing in /etc/NetworkManager/dnsmasq.d
Then Network Manager sets the DNS via DBus, as the configuration
(on command line) allows it. You can most probably find which DNS
servers are set by spying on DBus, using dbus-monitor. You can even set
up a bash script which shows a list of them in real time.
More information about the Dnsmasq-discuss