Discussion:
[Dnsmasq-discuss] Two issues on using the server option.
Hongyi Zhao
2015-10-01 15:40:31 UTC
Permalink
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?

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?

Regards
--
Hongyi Zhao <***@gmail.com>
Xinjiang Technical Institute of Physics and Chemistry
Chinese Academy of Sciences
GnuPG DSA: 0xD108493
Simon Kelley
2015-10-05 21:48:33 UTC
Permalink
Post by Hongyi Zhao
Hi Simon,
$ 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
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.
Post by Hongyi Zhao
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
(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.
Post by Hongyi Zhao
Regards
Loading...