DNS
DNS
Default DNS Configuration
[edit]Linux Default DNS Mechanism
[edit]On Linux, DNS libraries read the /etc/resolv.conf file. A DNS-resolving client such as Unbound is optional and not strictly required for basic DNS resolution.
/etc/resolv.conf
[edit]- Purpose: The
/etc/resolv.conffile is a standard configuration file in Linux systems used by DNS resolver libraries (likeglibc) to determine how to perform DNS resolution. - Contents: It typically contains information such as:
nameserverdirectives specifying the IP addresses of DNS servers.searchdomains andoptionsfor resolving queries.
DNS Resolver Libraries
[edit]- These libraries are part of most Linux systems and use
/etc/resolv.confto send DNS queries to the specified nameservers. - The libraries themselves handle basic DNS resolution without needing an external DNS resolver client.
DNS Resolver Clients
[edit]E.g., unbound, systemd-resolved.
- Optional: External DNS resolving software like
unboundorsystemd-resolvedis 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.confmight point to127.0.0.1(localhost), as the local resolver handles DNS queries before forwarding them.
Summary
[edit]- Basic DNS resolution on Linux relies on resolver libraries using
/etc/resolv.conf. - External DNS resolving clients like
unboundare 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
[edit]Disable System DNS
[edit]System DNS only. Not all DNS. See next chapter for all DNS.
1. Prerequisite knowledge:
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.
sudo cp /etc/resolv.conf ~/resolv.conf
3. Clear DNS configuration file.
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: use DNSCrypt by default in Kicksecure![]()
sudo chattr +i /etc/resolv.conf
5. Done.
System DNS has been disabled.
Disable All DNS
[edit]Many applications do actually not use system DNS but their own internal DNS implementation.DNS Security, chapter Potential Obstacles
Enabling systemd-resolved
[edit]Only for users that have a specific reason to want to use systemd-resolved.
Optional!
sudo touch /etc/dns-enable
sudo apt install systemd-resolved
sudo systemctl enable systemd-resolved
sudo systemctl start systemd-resolved
We believe security software like Kicksecure needs to remain Open Source and independent. Would you help sustain and grow the project? Learn more about our 13 year success story and maybe DONATE!