Comment 5 for bug 990660

Revision history for this message
Nathan Stratton Treadway (nathanst) wrote : Re: [Bug 990660] Re: dns-domain in interfaces appears as search in resolv.conf

On Sat, Apr 28, 2012 at 18:34:21 -0000, Jeffry A. Spain wrote:
> While I agree that the functional difference is perhaps
> immaterial, I would argue that mapping both "dns-domain"
> and "dns-search" in /etc/network/interfaces to "search"
> in resolv.conf serves only to increase the possibilities
> for confusion and errors, particularly since this mapping
> appears to be undocumented as well as unintuitive. For
> the sake of consistency, it makes sense either to map
> "dns-domain" to "domain" and "dns-search" to "search", or
> if you think the use of "domain" in resolv.conf should be
> deprecated, then eliminate "dns- domain" in interfaces.

Just to clarify the situation slightly, this mapping of
"domain" to "search" isn't specific to the
/etc/network/interfaces file, but applies to all resolvconf
"sources".

Basically, resolvconf can get resolv.conf information from
many difference sources (DHCP client, dns-* lines in the
"interfaces" file, VPN connections, etc), and in all those
cases it just stores the provided resolv.conf lines into
files found under /run/resolvconf/interfaces/ . (So in
other words those files can each contain various
combinations of "nameserver", "domain", "search", etc.
lines.)

Then as a separate step, resolvconf -- or, more
specifically, the /etc/resolvconf/update.d/libc script --
looks through all the saved information to build the new
/run/resolvconf/resolv.conf file ... and as part of that
process it combines all "domain" and "search" lines from
all the input sources into the single "search" line that
you see in the generated file.

Put another way, on the "publication" side resolvconf just
preserves whatever resolv.conf lines are provided to it
(and following that paradigm it supports both "dns-domain"
and "dns-search" options in the network/interfaces file,
just as both types of lines are supported coming from other
sources).

But on the "subscription" side, due to the restrictions of
the resolv.conf file, the only way to deal with multiple
occurences of either "domain" or "search" input lines is to
combine them all into a single "search" line in the
generated file.

[Given all that, I agree the resolvconf(8) page could
probably be made a bit more detailed. I'm not sure the
best way to do that, but perhaps it would work just to add
a paragraph to the discussion of the update.d/libc script
(in the SUBSCRIPTION section) describing the processing
done to generate the resolv.conf file (e.g. mentioning the
use of a single "search" line for all "domain" and "search"
input lines, that only the first three "nameserver" lines
found are used, etc.).]

     Nathan