Changing DNS on EndeavourOS KDE Edition

I have tried lots of way to change DNS and none worked so far.

I’ve tried systemd-resolved. This has this config but it has no effect, NetworkManager still uses Google DNS.

           Protocols: +LLMNR +mDNS -DNSOverTLS DNSSEC=no/unsupported
    resolv.conf mode: foreign
  Current DNS Server:
         DNS Servers:
Fallback DNS Servers:

Link 2 (enp58s0)
    Current Scopes: none
         Protocols: -DefaultRoute +LLMNR +mDNS -DNSOverTLS DNSSEC=no/unsupported
       DNS Servers:

Link 3 (wlan0)
    Current Scopes: DNS LLMNR/IPv4 LLMNR/IPv6 mDNS/IPv4 mDNS/IPv6
         Protocols: +DefaultRoute +LLMNR +mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server:
       DNS Servers:

/etc/resolv.conf still has in it:

# Generated by NetworkManager


I’ve tried using settings UI, but it doesn’t let me save changes. the button is disabled

So what’s the actual proper way to do it? Different sources say different things, and none of them works. NM DNS still gets reset to Google DNS

misc info:

❯ uname -mprs
Linux 6.7.4-arch1-1.1-g14 x86_64 unknown
❯ NetworkManager --version

Post the output of

$ cat /etc/nsswitch.conf
# Name Service Switch configuration file.
# See nsswitch.conf(5) for details.

passwd: files systemd
group: files [SUCCESS=merge] systemd
shadow: files systemd
gshadow: files systemd

publickey: files

hosts: mymachines resolve [!UNAVAIL=return] files myhostname dns
networks: files

protocols: files
services: files
ethers: files
rpc: files

netgroup: files

Look at this line. The dns entry (this will use /etc/resolv.conf) is the last item on the list. If you have systemd-resolved.service enabled, the dns hostname look up will prioritize systemd-resolved because resolve appears before dns.

The [!UNAVAIL=return] basically says to return and ignore file, myhostname and dns if systemd-resolved is able to resolve the hostname. In other words, if systemd-resolved.service is enabled and running, host name resolution will follow the systemd-resolved settings—whatever DNS server you specified in systemd-resolved will be used.

Use the dig or drill command or something to test which DNS is used.

systemd-resolved is running and enabled.

❯ sudo systemctl status systemd-resolved
● systemd-resolved.service - Network Name Resolution
     Loaded: loaded (/usr/lib/systemd/system/systemd-resolved.service; enabled; preset: enabled)
     Active: active (running) since Thu 2024-02-29 12:40:02 EET; 1h 12min ago
       Docs: man:systemd-resolved.service(8)
   Main PID: 702 (systemd-resolve)
     Status: "Processing requests..."
      Tasks: 1 (limit: 37919)
     Memory: 8.4M (peak: 10.9M)
        CPU: 1.363s
     CGroup: /system.slice/systemd-resolved.service
             └─702 /usr/lib/systemd/systemd-resolved

However, Google DNS is still used when running dig:


; <<>> DiG 9.18.24 <<>>
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 35963
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

; EDNS: version: 0, flags:; udp: 512
;                   IN      A

;; ANSWER SECTION:            20071   IN      A

;; Query time: 43 msec
;; SERVER: (UDP) # <---- here
;; WHEN: Thu Feb 29 13:54:11 EET 2024
;; MSG SIZE  rcvd: 56

That’s because dig is hardcoded to use /etc/resolv.conf by default.

Try drill instead.

I use


In /etc/NetworkManager/conf.d/dns.conf

And set the nameservers in /etc/resolv.conf manually.

It works on my end.

Same thing, even nslookup shows google DNS:

❯ drill
;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 19750
;; flags: qr rd ra ; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 
;; IN      A

;; ANSWER SECTION:    4107    IN      A



;; Query time: 36 msec
;; WHEN: Thu Feb 29 13:56:08 2024
;; MSG SIZE  rcvd: 45

❯ nslookup

Non-authoritative answer:
Address: 2606:2800:220:1:248:1893:25c8:1946

That doesn’t matter because he has systemd-resolved enabled.

Had this on both Arch nad on my fresh EndeavourOS (two days ago, fresh) install.

I’m using Controld dns.
I made changes to two files.
in /etc/systemd/resolved.conf
i changed the as follows

#  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.
# Entries in this file show the compile time defaults. Local configuration
# should be created by either modifying this file, or by creating "drop-ins" in
# the resolved.conf.d/ subdirectory. The latter is generally recommended.
# Defaults can be restored by simply deleting this file and all drop-ins.
# Use 'systemd-analyze cat-config systemd/resolved.conf' to display the full config.
# See resolved.conf(5) for details.

# Some examples of DNS servers which may be used for DNS= and FallbackDNS=:
# Cloudflare:
# Google:
# Quad9:

Where the XXXXXXXXXX in your personal address provided by Controld

And I created a file in /etc/NetworkManager/conf.d/dns.conf


sudo systemctl enable systemd-resolved.service
sudo systemctl start systemd-resolved.service

And my DNS was working as desired with ControlD

I don’t know what changes occur with both Arch and Endeavour, as the intructions provided by ControlD miss out on the dns.conf creation.

And EndeavourOS required the enabling systemd-resolved.service

But, it works for me.

It shouldn’t use systemd-resolved.

It will in this case. See the contents of his /etc/nsswitch.conf

If you are using systemd-resolved.service, you have two options. Either use a stub resolver, which will symlink your /etc/resolv.conf to the stub provided by systemd, or set the DNS servers manually.

It’s all here.

Alright I’ll rephrase my original question. How do I set Cloudflare DNS or Quad9 on EOS? I don’t care if through systemd-resolved or anyhow else. I just want it to work, so that my custom DNS is used.

Easiest way is to disable systemd-resolved.service, and then set the DNS servers in network manager directly. See @pebcak 's answer.


Personally, I set up my DNS servers manually using systemd-resolved in order to take advantage of caching.

To set your DNS servers in systemd-resolved, you simply have to add this file /etc/systemd/resolved.conf.d/dns.conf with the following contents:

DNS="put your DNS ip here"
Fallback="put your fallback DNS ip here"

Finally, it worked. I’ve stopped and disabled systemd-resolved and directly edited /etc/resolv.conf. What a mess DNS is on Linux…

This might be a better option.

On my end, however, I use dnscrypt-proxy and it has dns caching by default as well.

1 Like

This is not recommended. Because networkmanager will automatically regenerate this file every time you reboot. In order to get network manager to generate the correct DNS ips, you have to tell NetworkManager to do so. The only way to do that is to configure DNS on NetworkManager. If you are using a gui like network manager applet, you can probably do it graphically. But if you want to do it manually, you can check out the Arch Wiki:

Never heard of this before. But I will look into this. Thanks for sharing.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.