Linux

Where Is the systemd-resolved Config File?

systemd-resolved reads DNS settings from resolved.conf with runtime state in the run directory.

Last updated

systemd-resolved takes its DNS configuration from a config file listing servers, domains, and fallback behavior. The resolver also keeps runtime state in a run directory that resets every boot.

That split explains every resolv.conf mystery. The file most guides tell you to edit is a symlink to generated state, so changes vanish on reboot. Edit the config source instead and restart the service; the generated files follow from there.

Where Linux stores this, by platform

Linux
/etc/systemd/resolved.conf

DNS servers, domains, and fallback settings as plain text. Edit here and restart systemd-resolved; never edit the generated resolv.conf symlink directly.

Frequently asked questions

How do I set a custom DNS server permanently?

Edit resolved.conf and restart the resolver. The symlink at resolv.conf follows automatically, which beats editing the generated file that gets overwritten.

Notice an outdated path? Let us know.