[Dnsmasq-discuss] Two issues on using the server option.

Simon Kelley simon at thekelleys.org.uk
Mon Oct 5 22:48:33 BST 2015


On 01/10/15 16:40, Hongyi Zhao wrote:
> Hi Simon,
> 
> Please see the following two commands to running the dnsmasq:
> 
> $ sudo dnsmasq -d -q -R -h --server=/google.com/8.8.8.8#53
> --server=/google.com/8.8.4.4#53 -p 5356 --no-poll --all-servers
> dnsmasq: started, version 2.76test1-11-g4790115 cachesize 150
> dnsmasq: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP
> DHCPv6 Lua TFTP conntrack ipset auth DNSSEC loop-detect inotify
> dnsmasq: using nameserver 8.8.4.4#53 for domain google.com
> dnsmasq: using nameserver 8.8.8.8#53 for domain google.com
> dnsmasq: cleared cache
> 
> 
> $ sudo dnsmasq -d -q -R -h --server=/google.com/8.8.8.8#53
> --server=/google.com/8.8.4.4#53 -p 5356 --no-poll --all-server
> dnsmasq: started, version 2.76test1-11-g4790115 cachesize 150
> dnsmasq: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP
> DHCPv6 Lua TFTP conntrack ipset auth DNSSEC loop-detect inotify
> dnsmasq: using nameserver 8.8.4.4#53 for domain google.com
> dnsmasq: using nameserver 8.8.8.8#53 for domain google.com
> dnsmasq: cleared cache
> 
> About the above two commands, I have two issues:
> 
> 1-  It seems both of the `--all-server' and `--all-servers' are
> accepted by dnsmasq.  But according to the manpage, the correct usage
> should be `--all-servers'.  Any hints on this issue?

The options parsing library seems to accept the smallest unambiguous
option, it will accept --al, since that only matches --all-servers. It
won't accept --a, since that could be --all-servers or --address.

I didn't realise that this behaviour was provided. Interesting.


> 
> 2-  As you can see, in the above example, I use two nameservers as the
> resolvers for one specific domain.  I think if I can write them in the
> following form and it will be more concise:
> 
> (Note, the port number here can be negleted because it's  equql to the
> 53, I write here just for representation the more general form of this
> option)
> 
> --server=/google.com/8.8.8.8#53,8.8.4.4#53
> 
> But, I try the above form and dnsmasq failed to recgonize this form
> thus failed to start.
> 
> How about my suggstions on using this form with dnsmasq?

The syntax is unambiguous, so it could be done. You can already create
the configuration with two lines as you say.

Patches (including documentation) gratefully accepted!

Cheers,

Simon.

> 
> Regards
> 




More information about the Dnsmasq-discuss mailing list