[Dnsmasq-discuss] [PATCH] Support --server syntax in resolv-file

Kristian Evensen kristian.evensen at gmail.com
Mon Apr 10 09:34:35 BST 2017

Hi Simon,

On Fri, Apr 7, 2017 at 11:27 PM, Simon Kelley <simon at thekelleys.org.uk> wrote:
> The overriding objection to this is that it adds to the syntax and
> semantics of the resolv-file format, but dnsmasq doesn't "own" that
> format: it's actually a libc configuration file, and dnsmasq takes
> advantage of the fact that the format is "well known" to extract useful
> information from it. If you start adding extra fields to
> /etc/resolv.conf then the c-library will get upset.

I have been thinking some more about this. The reason for locking the
support for server-strings in the resolv behind a command line option,
was to avoid what you are describing here - compatibility issues with
the existing resolv-file format. I assume that if anyone enables the
option, they know what they are doing and what implications it might
have. I should maybe have explained this better in either the commit
or the addition to the man-page.

> I understand the desire to be able to specify resolvers dynamically with
> the full set of source-address and routing options; that's actually
> already available, and has been for a long time, using the DBus
> interface to dnsmasq, which includes the "SetDomainServers" method,
> which takes strings identical to argument to --server. I've not looked
> at the code, but your previous patch to allow binding both IP and
> interface should have automatically added that feature to
> SetDomainServers. (if it didn't then I'd certainly take a patch to
> correct that.)

I did a quick test and it seems that specifying servers (with the
additional interface/ip-information) using the DBus-interface works
fine. However, this does not help on systems not using DBus (like
OpenWRT/LEDE). Do you have any suggestions for an acceptable way to
implement this feature, without requiring the use DBus?

Thanks in advance for the help,

More information about the Dnsmasq-discuss mailing list