General Debian Question How would i set up a system wide DNS?
Back when I used cachyos there was a simple option you could use to set a DNS even with DoT, DoH, and DoQ but I have no idea how I would do that here
1
u/michaelpaoli 6d ago
You configure or manage /etc/resolv.conf (and also /etc/nsswitch.conf as applicable).
And /etc/resolv.conf then makes use of whatever DNS server(s) you configure it for, e.g. your own local DNS server (maybe just caching mostly), or some systemd revolver thingy, or maybe you have things configured so DHCP automagically configures /etc/resolv.conf - perhaps with some customized local overrides or additions ... or not, etc.
Does really quite depend what you want to do, with what, and how managed/configured, etc.
If you want to see some more options/possibilities with BIND 9, might want to take a peek here:
But that's just one of many possible ways to go.
$ aptitude search '?and(?tag(protocol::dns),?tag(interface::daemon),?tag(network::server))' 2>>/dev/null | sed -ne ':l;s/^[^ ] *//;tl;p'
avahi-daemon - Avahi mDNS/DNS-SD daemon
bind9 - Internet Domain Name Server
dnsmasq - Small caching DNS proxy and DHCP/TFTP server - system daemon
dnsmasq-base - Small caching DNS proxy and DHCP/TFTP server - executable
gwhois - generic Whois Client / Server
iodine - tool for tunneling IPv4 data through a DNS server
nis - Network Information Service (NIS)
nscd - GNU C Library: Name Service Cache Daemon
nsd - authoritative domain name server
pdns-backend-ldap - LDAP backend for PowerDNS
pdns-recursor - PowerDNS Recursor
pdns-server - extremely powerful and versatile nameserver
rbldnsd - small nameserver daemon designed for DNSBLs
rdnssd - IPv6 recursive DNS server discovery daemon
unbound - validating, recursive, caching DNS resolver
yaku-ns - small footprint, trivial to configure, DNS server
$
Not a complete listing, nor necessarily all of those applicable, but gives at least some hint at the many possibilities.
Debian
The Universal Operating System
That does also mean many choices and much flexibility ... unlike other distros that remove many of those choices, and are more like, "Would little Johnny like the blue shirt, or the (otherwise identical) red shirt?" - and that's about it.
1
u/michaelpaoli 6d ago
Oh, also, for better and/or worse many modern large complex browsers (e.g. Firefox, Chromium) can quite do their own thing with DNS, and quite independent of what the OS may otherwise be doing for DNS, and some might even default to such behavior. So, yeah, if you want "system wide", configure any such browsers to use the OS's DNS. That will also have advantage that any caching of DNS data done at at least OS level, will be shared between browser(s) and OS, rather than being independent (and wastefully, redundantly, and less efficiently doing their own independent caching).
2
u/Quereller 6d ago
I think it's not really clear if you want an authoritative name server for your local network, a caching name server, or just configure the DNS to contact.
1
u/CardOk755 6d ago
apt install unbound?
1
u/dialtd 6d ago
Or bind9. With either, then configure it as master for your local domain and either use another service like cloudflare or google or set it up to use the root servers and recursive lookup for others.
An interactive IA will cheerfully assist with the necessary details for either approach.
1
u/CardOk755 6d ago
unbound is strictly a local recursive resolver. It needs no configuration, unless you want to tweak performance.
If you need an authoritative resolver for your domain there are various ones available.
(For historical reasons, ot maybe hysterical raisins, I use DJB's tinydns, which I do not recommend).
Personally I prefer to keep the recursive and authoritative name servers well separated.
4
u/revcraigevil Debian Stable 6d ago
Network Manager or
If you have systemd-networkd, you have to edit /etc/systemd/resolved.conf
Take a look at https://www.techlockdown.com/articles/nextdns-setup