resolvconf ignores given dns-servers in /etc/network/interfaces

Bug #1284607 reported by Thomas Schweikle
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
dnsmasq (Ubuntu)
Invalid
Undecided
Unassigned
resolvconf (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

resolvconf ignores given dns-servers in /etc/network/interfaces if the interface in question is configured by dhcp:

auto em1
iface em1 inet dhcp
  dns-nameservers 10.161.18.34 10.129.18.34
  dns-search xxx.yy

the "dns-nameservers"-line is ignored (it shouldn't), while the "dns-search"-line is honoured:

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.0.1
search xxx.yy

Together with dnsmasq handling name resolution no names other tan local known ones are resolved.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: resolvconf 1.69ubuntu1
ProcVersionSignature: Ubuntu 3.13.0-12.32-generic 3.13.4
Uname: Linux 3.13.0-12-generic x86_64
ApportVersion: 2.13.2-0ubuntu5
Architecture: amd64
Date: Tue Feb 25 12:57:34 2014
InstallationDate: Installed on 2014-01-31 (25 days ago)
InstallationMedia: Ubuntu-Server 13.10 "Saucy Salamander" - Release amd64 (20131016)
PackageArchitecture: all
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 LANG=de_DE.UTF-8
 SHELL=/bin/bash
SourcePackage: resolvconf
UpgradeStatus: Upgraded to trusty on 2014-01-31 (25 days ago)

Revision history for this message
Thomas Schweikle (tps) wrote :
Revision history for this message
Stéphane Graber (stgraber) wrote :

By default, resolvconf will truncate the list of DNS servers after the loopback address. This can be overriden by putting TRUNCATE_NAMESERVER_LIST_AFTER_LOOPBACK_ADDRESS=no in /etc/default/resolvconf

This behaviour is documented in resolvconf's manpage.

Changed in resolvconf (Ubuntu):
status: New → Invalid
Revision history for this message
Nathan Stratton Treadway (nathanst) wrote : Re: [Bug 1284607] Re: resolvconf ignores given dns-servers in /etc/network/interfaces

On Tue, Feb 25, 2014 at 16:10:50 -0000, Stéphane Graber wrote:
> By default, resolvconf will truncate the list of DNS servers after the
> loopback address. This can be overriden by putting
> TRUNCATE_NAMESERVER_LIST_AFTER_LOOPBACK_ADDRESS=no in
> /etc/default/resolvconf
>
> This behaviour is documented in resolvconf's manpage.

[...]

> https://bugs.launchpad.net/bugs/1284607
>
> Title:
> resolvconf ignores given dns-servers in /etc/network/interfaces
>
[...]
> Bug description:
[...]
> Together with dnsmasq handling name resolution no names other tan
> local known ones are resolved.

The reason resolvconf stops with the lookback address by default is that
in most cases dsnmasq is sufficient to handle all name resolution. So
another approach to getting your system working would be to add your
hard-coded nameservers to the dnsmasq configuration rather than the
network/interfaces file.

      Nathan

Revision history for this message
deejoe (nyloco) wrote :

The use of TRUNCATE_NAMESERVER_LIST_AFTER_LOOPBACK_ADDRESS=no is defined in the resolvconf documentation.

However, the resolvconf documentation also says that one should be able to use dns-server settings in /etc/network/interfaces

This inconsistency is frustrating: Is dnsmasq getting its DNS server information from resolvconf, which in turn gets it from /etc/network/interfaces? Or, does dnsmasq take what it likes from /etc/network/interfaces directly, discarding the rest?

I've managed to get static DNS server settings configured into my machine by setting them in /etc/resolvconf/resolv.conf.d/base

/usr/share/doc/dnsmasq-base/README.Debian refers to settings in /etc/dnsmasq.conf but I had no luck configuring anything in this file, nor in /etc/dnsmasq.d/dnsmasq.conf

What's more, that documentation says /etc/dnsmasq.conf is "well commented" however that file seems not to exist in the package (therefor, none of its "good" comments exist in the package, either). Nor does /etc/defaults/dnsmasq exist. How is one to infer that that is the place to configure this package, especially in light of the contradictory information in the README.Debian file?

It seems the Ubuntu 14.04 use of dnsmasq departs significantly from the way it is used in Debian, but in poorly-documented ways, and in ways inconsistent with the documentation and its use alongside resolvconf. Perhaps adding an /etc/defaults/dnsmasq file with TRUNCATE_NAMESERVER_LIST_AFTER_LOOPBACK_ADDRESS=no in it, if in fact that works, would be a reasonable default. If /etc/network/interfaces is not used, then no harm done, but if it is done, then the package can respect that the system operator means for those settings to be used. This would be consistent with the broader behavior of network-manager, which also defers to settings made in /etc/network/interfaces.

Revision history for this message
deejoe (nyloco) wrote :

I mean of course that resolvconf documentation refers to using dns-nameservers (not "dns-server" as I wrote above).

I've added this as affecting dnsmasq-base, too. I think this is, at least, a documentation bug with regard to the interplay amongst resolvconf and dnsmasq and their configuration file. I'm not sure if it belongs to one package or the other, or both, or to yet some third thing.

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

> Is dnsmasq getting its DNS server information from resolvconf,
> which in turn gets it from /etc/network/interfaces? Or, does
> dnsmasq take what it likes from /etc/network/interfaces directly,
> discarding the rest?

1. If you have only the dnsmasq-base and network-manager packages installed then a dnsmasq process is run as a slave of NetworkManager and gets its nameserver information exclusively from NetworkManager. This dnsmasq process provides name service exclusively at IP address 127.0.1.1.

2. If you have the "dnsmasq" package installed then a(nother) dnsmasq process is run independently of NetworkManager. By default this independent dnsmasq service is configured to obtain its nameserver information exclusively from resolvconf which in turn gets nameserver information from interface configuration processes including ifup, whose configuration file is /etc/network/interfaces.

The fact that you have no /etc/dnsmasq.conf strongly suggests that you do not have the "dnsmasq" package installed and so you fall into class #1.

Dnsmasq itself never looks in /etc/network/interfaces.

To understand how resolvconf works, please consult /usr/share/doc/resolvconf/README.gz .

To understand how Ubuntu uses NetworkManager, dnsmasq and resolvconf, please consult https://www.stgraber.org/2012/02/24/dns-in-ubuntu-12-04/ .

Changed in dnsmasq (Ubuntu):
status: New → Invalid
Revision history for this message
deejoe (nyloco) wrote :

Thank you for the clarification with regard to the differences between the 'dnsmasq' and 'dnsmasq-base' packages.

The pointer to the resolvconf documentation, however, is less on-point, since my previous report makes reference already to the resolvconf documentation. Clearly, this isn't a question of how resolvconf works on its own, but how these packages interoperate specifically in an Ubuntu context.

It seems odd that understanding how these three packages interdepend in that context requires referring to non-free documentation outside of the project.

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.