{{Header}} {{title|title= DNS }} {{#seo: |description=DNS }}
/etc/resolv.conf
file. A DNS-resolving client such as Unbound is optional and not strictly required for basic DNS resolution.
== /etc/resolv.conf ==
* '''Purpose''': The /etc/resolv.conf
file is a standard configuration file in Linux systems used by DNS resolver libraries (like glibc
) to determine how to perform DNS resolution.
* '''Contents''': It typically contains information such as:
** nameserver
directives specifying the IP addresses of DNS servers.
** search
domains and options
for resolving queries.
== DNS Resolver Libraries ==
* These libraries are part of most Linux systems and use /etc/resolv.conf
to send DNS queries to the specified nameservers.
* The libraries themselves handle basic DNS resolution without needing an external DNS resolver client.
== DNS Resolver Clients ==
E.g., unbound
, systemd-resolved
.
* '''Optional''': External DNS resolving software like unbound
or systemd-resolved
is not strictly required for basic DNS resolution.
* '''Purpose''': These tools provide additional functionality, such as caching, advanced DNSSEC validation, or recursive DNS resolution.
* '''Integration''': When such a resolver is used, /etc/resolv.conf
might point to 127.0.0.1
(localhost), as the local resolver handles DNS queries before forwarding them.
== Summary ==
* Basic DNS resolution on Linux relies on resolver libraries using /etc/resolv.conf
.
* External DNS resolving clients like unbound
are optional and primarily used to enhance DNS functionality. They are not required for basic operations if a valid nameserver is defined in /etc/resolv.conf
.
= Disable DNS =
== Disable System DNS ==
System DNS only. Not all DNS. See next chapter for all DNS.
'''1.''' Prerequisite knowledge:
* [[write_protection|write protection]]
'''2.''' Backup the DNS configuration file /etc/resolv.conf
.
Optional. Might make re-enabling DNS later easier. Might be difficult or impossible for many users without this step.
{{CodeSelect|code=
sudo cp /etc/resolv.conf ~/resolv.conf
}}
'''3.''' Clear DNS configuration file.
{{CodeSelect|code=
sudo overwrite /etc/resolv.conf ""
}}
'''4.''' Enable write protection.
Optional. Useful to avoid future operating system updates overwriting the file such as when a distribution or derivative (such as Debian, Qubes Debian or Kicksecure) stat shipping a DNS configuration file. Note, if that was ever the case the upgrade of the package will fail and the user will be notified through the usual package manager (apt-get) output. This might happen if/when Kicksecure implements [[DNS Security]]. Forum discussion: [https://forums.whonix.org/t/use-dnscrypt-by-default-in-kicksecure-not-whonix/8117 use DNSCrypt by default in Kicksecure]
{{CodeSelect|code=
sudo chattr +i /etc/resolv.conf
}}
'''5.''' Done.
System DNS has been disabled.
== Disable All DNS ==
{{quotation
|quote=Many applications do actually not use system DNS but their own internal DNS implementation.
|context = [[DNS_Security#Potential_Obstacles|DNS Security, chapter Potential Obstacles]]
}}
= Enabling systemd-resolved =
Only for users that have a specific reason to want to use systemd-resolved
.
[[Untested]]!
{{Testers-only}}
{{AdvancedUsersOnly}}
Optional!
{{CodeSelect|code=
sudo touch /etc/dns-enable
}}
{{CodeSelect|code=
sudo apt install systemd-resolved
}}
{{CodeSelect|code=
sudo systemctl enable systemd-resolved
}}
{{CodeSelect|code=
sudo systemctl start systemd-resolved
}}
{{reflist|close=1}}
{{Footer}}
[[Category:Documentation]]