[Bug 1035098] Re: Also truncate nameserver list after a loopback address in resolv.conf.d/head
Thomas Hood
1035098 at bugs.launchpad.net
Fri Sep 21 09:14:22 UTC 2012
The dns-nameservers option will only have an effect when ifup is used.
I am not sure what you mean by 'restarting networking'. The lo
interface is normally only ifup'ped at boot time, but you can ifdown-
ifup it by hand. (Or you can reboot.)
I just tested this on my machine. I edited /etc/network/interfaces and
added a line "dns-nameservers 127.0.0.1" to the "iface lo" stanza.
auto lo
iface lo inet loopback
dns-nameservers 127.0.0.1
Then in a terminal I became root
sudo su
and I ifdown-ifupped the "lo" interface
ifdown lo
ifup lo
with the result that /etc/resolv.conf contained the following.
# 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
The lo stanza is the appropriate stanza to put it in. Under some circumstances you can also but the dns-nameservers option in the eth0 stanza, but note that if you have
[ifupdown]
managed=true
in /etc/NetworkManager/NetworkManager.conf then NetworkManager brings up
eth0 but it ignores the "dns-nameservers" option. On the other hand if
you have
managed=false
then eth0 should be ifupped at boot along with lo and the dns-
nameservers option should work. But I repeat that for a local caching
nameserver the "iface lo" stanza is the appropriate place to put a dns-
nameservers option if you really want to have one.
I want to add that normally you don't have to put a "dns-nameservers
127.0.0.1" option anywhere. Every nameserver in Ubuntu that listens by
default on 127.0.0.1 tells resolvconf to add the "nameserver 127.0.0.1"
line to resolv.conf when the nameserver starts and tells resolvconf to
remove that line when it stops. If that is not happening on your machine
then we should find out why not and fix that. (Open a new bug report for
that.)
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to resolvconf in Ubuntu.
https://bugs.launchpad.net/bugs/1035098
Title:
Also truncate nameserver list after a loopback address in
resolv.conf.d/head
Status in “resolvconf” package in Ubuntu:
New
Bug description:
I created a /etc/default/resolvconf file with the option:
TRUNCATE_NAMESERVER_LIST_AFTER_LOOPBACK_ADDRESS="yes"
in it.
The contents of /etc/resolvconf/resolv.conf.d/head are:
########################################
# 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
# local resolver (unbound)
nameserver ::1
nameserver 127.0.0.1
########################################
However, after rebooting, I still get my ISP's DNS servers below mine.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/resolvconf/+bug/1035098/+subscriptions
More information about the foundations-bugs
mailing list