You are not logged in.
Hi!
I'm trying to set up my computer to get ip, domain name and dns server from DHCP server. I'm using systemd-networkd with basic dhcp settings:
/etc/systemd/network/MyDhcp.network
------------------
[Match]
Name=en*
[Network]
DHCP=ipv4
The service is enabled and I get my ip address fine but the problem is with systemd-resolved.
When I enable systemd-resolved and set up a symlink from /run/systemd/resolve/resolv.conf to /etc/resolv.conf I can lookup dns names both from the Internet and locally but only if I type in the FQDN.
I read that I should update /etc/nsswitch.conf with the following:
hosts: files dns myhostname <-- old
hosts : files resolve mymachines myhostname <--- New
Problem is that with that config I get no dns at all. Whatever I try to ping I get "System error".
I want to be able to ping e.g. "server" instead of "server.mydomain" but I can't get it to work. Any help would be much appreciated!
Last edited by jfjallid (2015-10-10 16:55:40)
Offline
1000
Offline
I got it to work by adding:
[DHCP]
UseDomains=true
to /etc/systemd/network/MyDhcp.network
and reverting back to "hosts: files dns myhostname" in /etc/nsswitch.conf.
I'm still a bit confused as to when the resolve module should be used instead of dns in nsswitch.conf. When would that be used?
Offline
systemd-resolved implements caching.
1000
Offline