2023-12-26 09:51:30 +01:00
|
|
|
# Don't do this, just run this instead:
|
|
|
|
# sudo ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
|
2020-09-27 14:05:53 +02:00
|
|
|
|
2023-12-26 09:51:30 +01:00
|
|
|
# Problem: unbound is slow to start and everything complains of failing DNS,
|
|
|
|
# and systemd-resolved often gets itself stuck with DNSSEC.
|
|
|
|
# https://github.com/systemd/systemd/issues/10579 & https://github.com/systemd/systemd/issues/9867
|
|
|
|
# Solution that I dislike: use both unbound & systemd-resolved! When one
|
|
|
|
# breaks, maybe the other still works! Funnily /etc/resolv.conf is still
|
2024-04-23 15:23:36 +02:00
|
|
|
# restricted to three nameservers. However this may cause slowness unless
|
|
|
|
# the options timeout is specified and I increase attempts to further prefer
|
|
|
|
# unbound (which is listed twice).
|
2018-10-26 21:48:38 +02:00
|
|
|
|
2024-04-23 15:23:36 +02:00
|
|
|
# unbound or other local resolver
|
2023-12-26 09:51:30 +01:00
|
|
|
nameserver ::1
|
|
|
|
nameserver 127.0.0.1
|
2020-08-08 18:44:08 +02:00
|
|
|
|
2024-04-22 13:15:17 +02:00
|
|
|
# systemd-resolved. WARNING: May cause DNS leaks.
|
2023-12-26 09:51:30 +01:00
|
|
|
nameserver 127.0.0.53
|
2024-04-23 15:23:36 +02:00
|
|
|
# also systemd-resolved, but this is limited to three entries (others ignored)
|
|
|
|
#nameserver 127.0.0.54
|
2020-08-08 18:44:08 +02:00
|
|
|
|
2024-04-22 13:15:17 +02:00
|
|
|
# edns0 = extended DNS
|
2024-04-23 15:03:49 +02:00
|
|
|
# trust-ad = trust DNSSEC authenticated data
|
|
|
|
# timeout:1 = nameserver timeout 1 s (default 5, max 30), then next
|
2024-04-23 15:47:03 +02:00
|
|
|
# attempts:5 = if all nameservers fail, attempt again 5 times (def 2, max 5)
|
2024-04-23 15:03:49 +02:00
|
|
|
options edns0 trust-ad timeout:1 attempts:5
|
2018-08-10 16:18:33 +02:00
|
|
|
|
2023-12-26 09:51:30 +01:00
|
|
|
# no sending local domain to upstream whenever NXDOMAIN happens
|
|
|
|
search .
|
2020-07-23 21:59:53 +02:00
|
|
|
|
2023-12-26 09:51:30 +01:00
|
|
|
# PS. Remove empty lines and comments if this ends up in /etc/resolv.conf
|
|
|
|
# PPS. The traditional spell is:
|
|
|
|
# sudo chattr -i /etc/resolv.conf;sudo nvim /etc/resolv.conf;sudo chattr +i /etc/resolv.conf
|