dns-domain in interfaces appears as search in resolv.conf

Bug #990660 reported by Jeffry A. Spain
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
resolvconf (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

As recommended in the post http://www.stgraber.org/2012/02/24/dns-in-ubuntu-12-04/, I placed "dns-domain countryday.net" in an iface stanza in /etc/network/interfaces. The resulting resolv.conf file contains "search countryday.net" rather than "domain countryday.net" as I would have expected.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: resolvconf 1.63ubuntu11
ProcVersionSignature: Ubuntu 3.2.0-24.37-generic 3.2.14
Uname: Linux 3.2.0-24-generic x86_64
ApportVersion: 2.0.1-0ubuntu6
Architecture: amd64
Date: Sat Apr 28 13:53:55 2012
InstallationMedia: Ubuntu-Server 12.04 LTS "Precise Pangolin" - Release amd64 (20120424.1)
PackageArchitecture: all
ProcEnviron:
 TERM=linux
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: resolvconf
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Jeffry A. Spain (spainj) wrote :
Revision history for this message
Steve Langasek (vorlon) wrote :

Thanks for the report.

The distinction between 'domain' and 'search' should be immaterial; the only difference is that a 'domain' option allows only a single domain name, and 'search' allows multiple domains. So the use of 'search' for a single domain is not a bug, and is more consistent with the case in which multiple domain names are specified.

Changed in resolvconf (Ubuntu):
status: New → Invalid
Revision history for this message
Jeffry A. Spain (spainj) wrote : RE: [Bug 990660] Re: dns-domain in interfaces appears as search in resolv.conf

> The distinction between 'domain' and 'search' should be immaterial; the only difference is that a 'domain' option allows only a single domain name, and 'search' allows multiple domains. So the use of 'search' for a single domain is not a bug, and is more consistent with the case in which multiple domain names are specified.

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. Thanks for your further consideration.

Jeffry A. Spain
Network Administrator
Cincinnati Country Day School

Revision history for this message
Thomas Hood (jdthood) wrote :

Yes, perhaps this should be better documented. I'll look into it.

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

Revision history for this message
Thomas Hood (jdthood) wrote :

In resolvconf version 1.66 the man page has been improved, with Nathan's help.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.