Ubuntu – Ubuntu 18.04 does not get search domain from DHCP server

18.04dhcpdnssystemd-networkdsystemd-resolved

I have a system with Ubuntu 18.04 on it, and there have been some (apparently) radical changes in the way DHCP client and DNS are handled.

After stumbling through documentation on systemd-resolved, I've figured out that for whatever reason:

  1. Dhclient is not running, and is apparently not the daemon responsible for obtaining a DHCP IP anymore?
  2. That whatever IS handling getting dhcp (systemd.networkd?) is ignoring the search domain information being passed by my DHCP server
  3. Running "dhclient" resolves this

See screenshot below, sorry for tiny text:

resolv.conf not showing search domain until dhclient is typed

Note that "dhclient" requested (and got) a different IP, which was overwritten by systemd-networkd at some point since the system reverted back to 25.207 silently.

Finally, restarting network services with systemctl restart networkd-systemd and restarting resolved with systemctl restart systemd-resolved leaves the search line in place in the symlink at /etc/resolv.conf after "dhclient" is typed.

Can someone point me to documentation on what's handling DHCP for ubuntu 18.04 now, and why it might not be pulling search domain information and setting it properly in systemd-resolved?

Best Answer

If you do not use dhclient, /etc/resolv.conf is a symlink to /run/resolv/resolv.conf. However, the config file used by systemctl to set the DNS servers if in /run/systemd/resolve/resolv.conf.

Updating /etc/resolv.conf to point to the file generated by systemd resolves this issue.

Related Question