Re: peerdns reversed?



On 04/23/2014 11:39 AM, Dan Williams wrote:
On Tue, 2014-04-22 at 11:27 -0400, Sean Darcy wrote:
On 04/21/2014 05:28 PM, Dan Williams wrote:
On Sun, 2014-04-20 at 21:15 -0400, Sean Darcy wrote:
on Fedora 20:

cat /etc/sysconfig/network-scripts/ifcfg-external
# Please read /usr/share/doc/initscripts-*/sysconfig.txt
# for the documentation of these parameters.
TYPE=Ethernet
BOOTPROTO=dhcp
DEVICE=external
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
PEERDNS=no
DNS1=127.0.0.1
DNS2=8.8.8.8
## PEERROUTES=yes
USERCTL=no

cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 127.0.0.1
nameserver 8.8.8.8

but if I set PEERDNS=yes:

cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 167.206.251.130
nameserver 167.206.251.129
nameserver 127.0.0.1
# NOTE: the libc resolver may not support more than 3 nameservers.
# The nameservers listed below may not be recognized.
nameserver 8.8.8.8

Isn't this the wrong way around?

Currently any additional static DHCP servers are appended to those
detected from DHCP.  So I think this is the intended functionality.  I'm
assuming you'd rather have them prepended instead?

But since you're using 127.0.0.1, it seems unlikely that you want any
nameservers at all, but you'll want to use a local caching nameserver?
NM has some built-in functionality for that already using dnsmasq, see
'man NetworkManager.conf' in the section about DNS.

Dan


Thanks for the reply. I'll look at dnsmasq. Thanks for the lead.

But really I'm just trying to overide the isp's dns servers. I've looked
up PEERDNS in sysconfig.txt, from Fedora's initscripts-9.51-2.fc20.

PEERDNS=yes|no
        modify /etc/resolv.conf if peer uses msdns extension (PPP only) or
        DNS{1,2} are set, or if using dhclient. default to "yes".
DNS{1,2}=<ip address>
        provide DNS addresses that are dropped into the resolv.conf
        file if PEERDNS is not set to "no".

As I read this, if PEERDNS is set to "no" the DNS addresses not dropped
into resolv.conf. If "yes", they are, but no mention of pre- or ap- pend.

Your reading appears to match the code in ifup-post.

Now if you set PEERDNS to "no" NM puts only the connection DNS addresses
in resolv.conf. If "yes" NM appends them to the dhcp adresses.

Correct, NM's interpretation does appear to be different.

I prefer the wholesale replacement, since I don't want to use the isp's
servers, so I probably shouldn't complain about the inconsistency. Is
the way NM handles the entries in the ifcfg- scripts described anywhere?
Perhaps I should not have been looking at sysconfig.txt?

For the ifcfg file format, the goal is to keep NetworkManager's
interpretation as close to the old initscripts as possible.  So in the
vast majority of cases, there should be no difference between
sysconfig.txt and NetworkManager.

However, there are some areas where differences occur, and it looks like
you've found one.  Our documentation needs to be better, and I've filed:

https://bugzilla.gnome.org/show_bug.cgi?id=728802

to track the issue.  Thanks for the report!

Dan


Thanks.

FWIW, I prefer the way NM handles PEERDNS now, rather than the description in initscripts. Of course, I don't know whether the network stack prepends or appends the DNS addresses from the scripts when PEERDNS is set yes.

sean



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]