resolv.conf not updated?

Got problems with your B2 or B3? Share and get helped!
Post Reply
stasheck
Posts: 107
Joined: 15 Jan 2014, 13:13

resolv.conf not updated?

Post by stasheck » 07 Nov 2015, 12:48

Stupid thing, and I already solved it once, but apparently forgot how I did that.

My secondary B3 does not update resolv.conf with info from DHCP. It's running Arch (sakaki build). All updated to newest packages. It simply leaves resolv.conf with:
# This file is managed by systemd-resolved(8). Do not edit.
#
# Third party programs must not access this file directly, but
# only through the symlink at /etc/resolv.conf. To manage
# resolv.conf(5) in a different way, replace the symlink by a
# static file or a different symlink.

# No DNS servers known.
The proper B3 has:
# Generated by resolvconf
domain <my-domain>
nameserver <ns-1>
nameserver <ns-2>
Please help, I've been fighting this for the last 3 hours ;( The only info I seem to be able to find on Google is the exact opposite - "how to prevent DHCP from overwriting resolv.conf".

stasheck
Posts: 107
Joined: 15 Jan 2014, 13:13

Re: resolv.conf not updated?

Post by stasheck » 10 Nov 2015, 03:59

Ha. Ha. Ha.

Turns out I have _not_ solved this before - it's just for some weird reason on my primary box 'resolvconf -u' is run after 'systemd-resolved'.

The proper solution:
Add /etc/systemd/network/eth0.network

Code: Select all

[Match]
Name=eth0

[Network]
DHCP=ipv4

[DHCP]
UseDNS=True
Then:

Code: Select all

systemctl enable systemd-networkd
systemctl start systemd-networkd
Now I have my DNS.

Still don't know why it works on primary system, I must check what will happen if I disconnect&reconnect wan interface.

sakaki
Posts: 172
Joined: 15 Aug 2014, 11:20

Re: resolv.conf not updated?

Post by sakaki » 10 Nov 2015, 13:52

Hi stasheck,

just seen something similar myself (rebuilding the Arch live-USB image at the moment). Think there may be a clash between netctl and the native systemd network provisioning, under the current rev of systemd. Creating the /etc/systemd/network/... files (as you have done) is a better way to go, in any event.

On your other box, do you have any active netctl profiles (or do you have netctl-auto.service enabled)?

Best, sakaki

PS I have updated the wiki text Set Up Your B3 as a WiFi Gateway Server to reflect the migration from netctl. Also, the new 1.2.0 Arch live-USB should be out in a day or so.

stasheck
Posts: 107
Joined: 15 Jan 2014, 13:13

Re: resolv.conf not updated?

Post by stasheck » 10 Nov 2015, 14:04

The other box is router/server, set up according to your instructions - so that'd be a 'yes'.

sakaki
Posts: 172
Joined: 15 Aug 2014, 11:20

Re: resolv.conf not updated?

Post by sakaki » 15 Nov 2015, 09:02

Well, on the one hand 'if it ain't broke'... but there does appear to be a move away from netctl (for example, the newer ArchLinuxArm tarballs now ship with networkd rather than netctl enabled by default), so, you might wish to migrate your other box to networkd also, to avoid any issues in future. The wiki contains the updated instructions for the bridge netdev file etc (and the new Arch live-USB for B3 also ships with this configuration, which may be useful as a concrete reference). The arch wiki page on networkd is also a good resource.

Best, sakaki

Post Reply