[systemd-devel] systemd-resolved : How to change permanently to 127.0.0.54

Adam Nielsen a.nielsen at shikadi.net
Mon Dec 23 16:19:25 UTC 2024


> My DNS servers are currently manually specified in
> /etc/systemd/network/10-ens.network as follows:
> 
> [Match]
> Name=en*
> [Network]
> DHCP=ipv4
> DNS=first-server-ip-goes-here
> DNS=second-server-ip-goes-here
> DNS=third-server-ip-goes-here
> [DHCPv4]
> UseDNS=false
> UseNTP=false
> [IPv6AcceptRA]
> 
> So (as I understand it) its not the setup of the DNS client config
> per-se but the need to kill the proxying done by 127.0.0.53.   My
> understanding was the "right" way was referring to 127.0.0.54 instead
> ?

I have a similar set up, however I have set DNSStubListener=no in
/etc/systemd/resolved.conf.

This disables the 127.0.0.x service entirely, and puts the DNS servers
you have manually configured above into the /etc/resolv.conf symlink
target.

This means in your case Postfix and other system services will contact
the DNS servers directly.  Since the 127.0.0.54 address you are wanting
to use simply proxies requests to these servers unchanged, you should
get the same result by having the programs directly contact the DNS
servers without using the proxy at all.

This may impact DNS lookup speeds (as systemd-resolved won't always be
in the path to cache the results) however in my case the DNS server is
on my local LAN and does caching itself so there's little impact.

Cheers,
Adam.


More information about the systemd-devel mailing list