Hey,
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.
Global
Protocols: +LLMNR +mDNS -DNSOverTLS DNSSEC=no/unsupported
resolv.conf mode: foreign
Current DNS Server: 1.1.1.1#cloudflare-dns.com
DNS Servers: 1.1.1.1#cloudflare-dns.com 1.0.0.1#cloudflare-dns.com 2606:4700:4700::1111#cloudflare-dns.com
Fallback DNS Servers: 1.1.1.1#cloudflare-dns.com 9.9.9.9#dns.quad9.net 8.8.8.8#dns.google 2606:4700:4700::1111#cloudflare-dns.com
2620:fe::9#dns.quad9.net 2001:4860:4860::8888#dns.google
Link 2 (enp58s0)
Current Scopes: none
Protocols: -DefaultRoute +LLMNR +mDNS -DNSOverTLS DNSSEC=no/unsupported
DNS Servers: 9.9.9.9 149.112.112.112
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: 149.112.112.112
DNS Servers: 149.112.112.112 9.9.9.9
/etc/resolv.conf still has 8.8.8.8 in it:
# Generated by NetworkManager
nameserver 8.8.8.8
nameserver 8.8.4.4
I’ve tried using settings UI, but it doesn’t let me save changes. the button is disabled
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.
Hint:
Use the dig or drill command or something to test which DNS is used.
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.
[Resolve]
# Some examples of DNS servers which may be used for DNS= and FallbackDNS=:
# Cloudflare: 1.1.1.1#cloudflare-dns.com 1.0.0.1#cloudflare-dns.com 2606:4700:4700::1111#cloudflare-dns.com 2606:4700:4700::1001#cloudflare-dns.com
# Google: 8.8.8.8#dns.google 8.8.4.4#dns.google 2001:4860:4860::8888#dns.google 2001:4860:4860::8844#dns.google
# Quad9: 9.9.9.9#dns.quad9.net 149.112.112.112#dns.quad9.net 2620:fe::fe#dns.quad9.net 2620:fe::9#dns.quad9.net
DNS=76.76.2.22#XXXXXXXXXXX.dns.controld.com
#FallbackDNS=1.1.1.1
#FallbackDNS=1.1.1.1#cloudflare-dns.com 9.9.9.9#dns.quad9.net 8.8.8.8#dns.google 2606:4700:4700::1111#cloudflare-dns.com 2620:fe::9#dns.quad9.net 2001:4860:4860::8888#dns.google
#Domains=
#DNSSEC=no
DNSOverTLS=yes
#MulticastDNS=yes
#LLMNR=yes
#Cache=yes
#CacheFromLocalhost=no
#DNSStubListener=yes
#DNSStubListenerExtra=udp:127.0.0.1:53
#ReadEtcHosts=yes
#ResolveUnicastSingleLabel=no
#StaleRetentionSec=0
Where the XXXXXXXXXX in your personal address provided by Controld
And I created a file in /etc/NetworkManager/conf.d/dns.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.
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.
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: