[Dnsmasq-discuss] Finding actual DNS server used
Chris Green
cl at isbd.net
Sun Jan 15 20:31:28 GMT 2017
On Sun, Jan 15, 2017 at 04:54:11PM +0100, Albert ARIBAUD wrote:
> Bonjour,
>
> 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
> > --pid-file=/var/run/NetworkManager/dnsmasq.pid
> > --listen-address=127.0.1.1 --cache-size=0 --conf-file=/dev/null
> > --proxy-dnssec
> > --enable-dbus=org.freedesktop.NetworkManager.dnsmasq
> > --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.
>
Is there any description anywhere of how to do this?
--
Chris Green
More information about the Dnsmasq-discuss
mailing list