[Libvir] PATCH: Use --strict-order with dnsmasq

A bug reported by David Lutterkort... The 'man resolv.conf' docs for 'nameserver' say [quote] nameserver Name server IP address Internet address (in dot notation) of a name server that the resolver should query. Up to MAXNS (currently 3, see <resolv.h>) name servers may be listed, one per keyword. If there are multi- ple servers, the resolver library queries them in the order listed. If no nameserver entries are present, the default is to use the name server on the local machine. (The algorithm used is to try a name server, and if the query times out, try the next, until out of name servers, then repeat trying all the name servers until a maximum number of retries are made.) [/quote] While 'man dnsmasq' docs for 'strict-order' say: [quote] -o, --strict-order By default, dnsmasq will send queries to any of the upstream servers it knows about and tries to favour servers to are known to be up. Setting this flag forces dnsmasq to try each query with each server strictly in the order they appear in /etc/resolv.conf [/quote] So by default, the algorithm dnsmasq uses for DNS lookups is a) Different from that use by GLibC b) Wrong Thus I think we should always use --strict-order when running dnsmasq. The attached patch adds this Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|

Daniel P. Berrange wrote:
So by default, the algorithm dnsmasq uses for DNS lookups is
a) Different from that use by GLibC b) Wrong
Thus I think we should always use --strict-order when running dnsmasq. The attached patch adds this
The patch is fine, but I don't understand why you think the dnsmasq algorithm is any less right than the glibc/resolver one. Rich. -- Emerging Technologies, Red Hat http://et.redhat.com/~rjones/ 64 Baker Street, London, W1U 7DF Mobile: +44 7866 314 421 Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Directors: Michael Cunningham (USA), Charlie Peters (USA) and David Owens (Ireland)

On Tue, May 01, 2007 at 01:39:54PM +0100, Richard W.M. Jones wrote:
Daniel P. Berrange wrote:
So by default, the algorithm dnsmasq uses for DNS lookups is
a) Different from that use by GLibC b) Wrong
Thus I think we should always use --strict-order when running dnsmasq. The attached patch adds this
The patch is fine, but I don't understand why you think the dnsmasq algorithm is any less right than the glibc/resolver one.
The list of nameservers is a prioritized lists, so by trying a random nameserver you may get different DNS results returned, compared to using them in sorted orders. Nameservers may also be ordered by locality, for example the first 2 nameservers are on my local LAN, but the 3rd nameserver is a 'failsafe' on the WAN. The first will give much faster loookup result that the last. Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|

On Tue, May 01, 2007 at 01:24:35PM +0100, Daniel P. Berrange wrote:
A bug reported by David Lutterkort...
The 'man resolv.conf' docs for 'nameserver' say
[quote] nameserver Name server IP address Internet address (in dot notation) of a name server that the resolver should query. Up to MAXNS (currently 3, see <resolv.h>) name servers may be listed, one per keyword. If there are multi- ple servers, the resolver library queries them in the order listed. If no nameserver entries are present, the default is to use the name server on the local machine. (The algorithm used is to try a name server, and if the query times out, try the next, until out of name servers, then repeat trying all the name servers until a maximum number of retries are made.) [/quote]
While 'man dnsmasq' docs for 'strict-order' say:
[quote] -o, --strict-order By default, dnsmasq will send queries to any of the upstream servers it knows about and tries to favour servers to are known to be up. Setting this flag forces dnsmasq to try each query with each server strictly in the order they appear in /etc/resolv.conf [/quote]
So by default, the algorithm dnsmasq uses for DNS lookups is
a) Different from that use by GLibC b) Wrong
Thus I think we should always use --strict-order when running dnsmasq. The attached patch adds this
Committed. Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|
participants (3)
-
Daniel P. Berrange
-
Mark McLoughlin
-
Richard W.M. Jones