How can I replace my DNS? I am not using a network manager, except for systemd-networkd and wpa_supplicant for wireless, with wpa_cli. I'm on Arch Linux, if it matters.

Although I can add DNS to my config, systemctl restart systemd-resolved overwrites /etc/resolv.conf (sym linked to /run/systemd/resolve/resolv.conf), or a reboot, somehow add the default ISP DNS's to /etc/resolv.conf. Does anyone know why, or how to resolve this issue to only use the DNS that I configured?

When I edit /etc/resolv.conf to only contain


and run systemctl restart systemd-resolved or do a reboot, the default ISP DNS's are overwritten, and cat /etc/resolv.conf is this:

# This file is managed by systemd-resolved(8). Do not edit.
# Third party programs must not access this file directly, but
# only through the symlink at /etc/resolv.conf. To manage
# resolv.conf(5) in a different way, replace the symlink by a
# static file or a different symlink.

# Too many DNS servers configured, the following entries may be ignored.

As described under man resolved.conf, I ensured that I only have one config file, /etc/systemd/resolved.conf.d/resolv.conf, containing

#  This file is part of systemd.
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.
# See resolved.conf(5) for details

#FallbackDNS= 2001:4860:4860::8888 2001:4860:4860::8844

and no other files defining my DNS from all the configuration files under here:





I don't believe I am running any dhcpcd or netctl service either, and systemctl | grep dhcpcd, and systemctl | grep netctl returns nothing.


I resolved this issue by adding the following to my network profiles under /etc/systemd/network/*.network:


By default, this is true, meaning DNS servers are pulled from the DHCP network connection. If I disable this feature, and input my own static DNS (ie OpenDNS), then I can ensure that I will only be using the DNS of my choosing.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.