rusty-snakes DNS Setup #5828
rusty-snake
started this conversation in
Show and tell
Replies: 1 comment
-
My setup is rather opposite, it's based on
One weakness is that browsers need access to HTTP ports, which could also serve DoH. I could also block known open DNS providers like 8.8.8.8 from them, but I'd like to avoid that kind of whack-a-mole. Some kind of simple filtering HTTP or SOCKS proxy would be nice, but it would also have to support different rules for different applications (apt, browser, flatpak, games, git, MUA, etc.). I'm also considering how to integrate opensnitch into this setup. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Outsourced discussion from #5825 - @Rosika2
Beforehand, I use Fedora and everything here assumes
the default of Fedora.
Advantages
Disable systemd-resolved
systemd-resolved
work a bit special and does not provide all the features that I want.Futhermore
authselect
does not have a profile/feature to disableresolve
and preferdns
.Therefore we disable
systemd-resolved
:Disable NetworkManager resolv.conf and DNS management
/etc/NetworkManager/NetworkManager.conf
:Remeber to
systemctl restart NetworkManager.service
.Replace
/etc/resolv.conf
dnsmasq
Install
dnsmasq
if it is not installed.Harden
dnsmasq.service
/etc/systemd/system/dnsmasq.service.d/override.conf
Create dnsmasq config
/etc/dnsmasq.d/50-custom.conf
:Bad domain blocking (hosts-file)
You can add domains to a hosts file added via
addn-hosts
like we did with/etc/dnsmasq-hosts-blocklist
:Bad domain blocking (address-option)
A second way to block domains is to add a configuration file that use the
address
option liketo return
NXDOMAIN
orto return
0.0.0.0
/::
.This file can be much smaller because you do not need repeated lines for IPv6 nor for subdomains.
I do this with my own tool that downloads a hosts file, sanitizes and deduplicates it and outputs a dnsmasq configuration file. https://gitlab.com/rusty-snake/uhb2dnsmasq.
Start dnsmasq
systemctl enable --now dnsmasq.service
Beta Was this translation helpful? Give feedback.
All reactions