You are not logged in.

#1 2015-06-24 07:31:53

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,426

[SOLVED] not getting dns from dhcp due to systemd-resolved

When my machine boots, i correctly get ip and dns addresses from dhcp.
But if the carrier goes down and back after a while, then i only get the ip address from dhcp.
/etc/resolv.conf uses hardcoded fallback google dns in systemd-resolved.
I dont want this, i want to still use the dns provided by dhcp.
I tried to explcitely disable any fallback dns address from resolved.conf by setting "FallbackDNS=" (an empty string), but that just produced a blank /etc/resolv.conf

See what happens from journalctl when the carrier goes down, then up:

giu 24 08:49:25 slimer systemd-timesyncd[131]: Network configuration changed, trying to establish connection.
giu 24 08:49:25 slimer systemd-networkd[29605]: eth0            : lost carrier
giu 24 08:49:25 slimer systemd-networkd[29605]: eth0            : DHCP lease lost
giu 24 08:49:25 slimer avahi-daemon[181]: Withdrawing address record for 192.168.15.16 on eth0.
giu 24 08:49:25 slimer avahi-daemon[181]: Leaving mDNS multicast group on interface eth0.IPv4 with address 192.168.15.16.
giu 24 08:49:25 slimer avahi-daemon[181]: Interface eth0.IPv4 no longer relevant for mDNS.
giu 24 08:49:35 slimer systemd-timesyncd[131]: Timed out waiting for reply from 93.62.188.182:123 (0.arch.pool.ntp.org).
giu 24 08:49:42 slimer kernel: smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0x41E1
giu 24 08:49:42 slimer systemd-networkd[29605]: eth0            : gained carrier
giu 24 08:49:42 slimer avahi-daemon[181]: Joining mDNS multicast group on interface eth0.IPv4 with address 192.168.15.16.
giu 24 08:49:42 slimer avahi-daemon[181]: New relevant interface eth0.IPv4 for mDNS.
giu 24 08:49:42 slimer avahi-daemon[181]: Registering new address record for 192.168.15.16 on eth0.IPv4.
giu 24 08:49:42 slimer systemd-networkd[29605]: eth0            : DHCPv4 address 192.168.15.16/24 via 192.168.15.1

after that:

 # cat /etc/resolv.conf 
# 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.

But if i restart systemd-networkd by hand, all is good again:

$ cat /etc/resolv.conf 

# 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.

nameserver 192.168.15.1

Nothing relevant in journalctl:

giu 24 09:17:28 slimer systemd[1]: Stopping Network Service...
giu 24 09:17:28 slimer systemd[1]: Starting Network Service...
giu 24 09:17:29 slimer systemd-timesyncd[131]: No network connectivity, watching for changes.
giu 24 09:17:29 slimer systemd-timesyncd[131]: No network connectivity, watching for changes.
giu 24 09:17:29 slimer systemd-timesyncd[131]: No network connectivity, watching for changes.
giu 24 09:17:29 slimer systemd-timesyncd[131]: No network connectivity, watching for changes.
giu 24 09:17:29 slimer systemd-networkd[29911]: Enumeration completed
giu 24 09:17:29 slimer systemd[1]: Started Network Service.
giu 24 09:17:29 slimer systemd-networkd[29911]: eth0            : DHCPv4 address 192.168.15.16/24 via 192.168.15.1
giu 24 09:17:29 slimer systemd-networkd[29911]: eth0            : link configured

If i disable/stop systemd-resolved, all work as expected; when network go down/up, i get the correct ip and resolv.conf is filled with dns servers from dhcp.

As far as i understood about systemd-resolved, it has caching capabilities; so if i am right i'd like to find a way to keep it running.

So the question is: am i forced to disable systemd-resolved?

thanks.

-EDIT
I disabled systemd-resolved and i rebooted the machine.
Now /etc/resolv.conf is just blank, and even restarting systemd-networkd does not do the trick.
I'm a bit lost...

# cat /etc/systemd/network/eth0.network 
[Match]
Name=eth0

[Network]
DHCP=both

-EDIT
Disabling systemd-resolved is not going to work (even the arch wiki says that).
But the main question remains:

* how can i get dns from dhcp when the network returns?

Last edited by kokoko3k (2015-06-29 14:35:19)


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#2 2015-06-24 07:45:34

delx
Member
Registered: 2015-02-08
Posts: 13

Re: [SOLVED] not getting dns from dhcp due to systemd-resolved

I have the same problem. I worked around it by adding a line to my .network file with DNS=<myserver>.

Of course this is not a good general solution.

Offline

#3 2015-06-24 07:58:57

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,426

Re: [SOLVED] not getting dns from dhcp due to systemd-resolved

Perfectly agree.


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#4 2015-06-24 08:14:57

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,426

Re: [SOLVED] not getting dns from dhcp due to systemd-resolved

Ok, wait, i just updated from systemd 219 to 221 and now it works, even if in systemd changelog there seems to be nothing relevant.
Does it for you delx?

Last edited by kokoko3k (2015-06-24 08:16:45)


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#5 2015-06-28 12:33:21

delx
Member
Registered: 2015-02-08
Posts: 13

Re: [SOLVED] not getting dns from dhcp due to systemd-resolved

It does seem to be fixed smile

Offline

#6 2015-06-29 14:34:42

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,426

Re: [SOLVED] not getting dns from dhcp due to systemd-resolved

Not a word in systemd changelog...


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

Board footer

Powered by FluxBB