[systemd-devel] systemd-resolved and dhclient nameservers

Mantas Mikulėnas grawity at gmail.com
Fri Apr 7 20:46:00 UTC 2023


Systemd-resolved can't actually see your leases all on its own; the DHCP
client needs to provide it that information. Networkd and NetworkManager do
it directly through the D-Bus IPC.

For standalone dhcpcd, you would likely need to install the `resolvconf`
emulation that comes with systemd (usually packaged separately to avoid
conflicts with the real resolvconf/openresolv), or find a hook script that
would upload the configuration using resolvectl. For dhclient, probably the
same.

On Fri, Apr 7, 2023, 19:50 Alex Cheamitru <apcheamitru at gmail.com> wrote:

> Hi,
>
> I'm curious about whether or not dhclient-provided DNS servers will be
> added to resolv.conf when it is managed by systemd-resolved.  The man page
> mentions *"... **and dynamically at run time, for example from DHCP
> leases",* but I'm not sure if that only applies to systemd-networkd
> leases.
>
> To test, I emptied my current resolv.conf (which contained
> dhclient-provided nameservers) and started systemd-resolved.
>
> > /etc/resolv.conf
> systemctl start systemd-resolved
>
> After doing this, I see no nameservers defined
> in /run/systemd/resolve/resolv.conf.
>
> Is that expected behavior?  I was hoping to see my DHCP-provided
> nameservers in resolv.conf, but that wasn't the case.
>
> Thanks,
> Alex
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20230407/0ada94b7/attachment.htm>


More information about the systemd-devel mailing list