Where Are Linux DNS Settings Stored?
Linux resolves names using resolv.conf, a small file that symlinks, stubs, and managers fight over constantly.
Last updated
Resolv.conf is three lines that cause endless confusion. Nameserver entries list where lookups go, search domains complete short names. Simple until every network tool wants ownership.
Modern systems layer managers atop it: resolvconf frameworks, systemd-resolved stubs, NetworkManager writers. The file you read may be a symlink into a generated stub rather than anyone's real config. Understanding which layer writes it ends the revert wars.
Where Linux stores this, by platform
/etc/resolv.conf
Nameservers and search domains live here, often as a generated stub. Configure DNS through your network manager instead of editing directly.
Frequently asked questions
My edits to resolv.conf keep reverting. Why?
Something manages it: NetworkManager, systemd-resolved, DHCP clients, or VPN software each claim the file. Identify the manager first, then configure DNS through it instead of editing the file into oblivion.
How do I see the real DNS servers?
Check resolvectl status for the per link servers systemd actually uses. The stub file points at 127.0.0.53 while real upstreams hide in the resolver state. Query the manager, not the file.
Notice an outdated path? Let us know.