1
Fork 0
tiny dns resolver with block list
Find a file
2025-10-19 16:31:12 -04:00
unifi-os Improve systemd service and add upload recipe 2025-08-09 00:22:58 +01:00
.gitignore Add build arm64 in justfile 2025-06-27 09:24:12 -04:00
blockedhosts.go Clean up a little 2025-10-19 16:16:52 -04:00
cache.go Don't cache if ttl is 0 2025-08-20 22:20:11 +01:00
config.go Clean up a little 2025-10-19 16:16:52 -04:00
doh-hole.service Improve systemd service and add upload recipe 2025-08-09 00:22:58 +01:00
doh.go Cleanup some 2025-08-18 12:17:34 +01:00
go.mod Update dependencies 2025-08-18 11:46:23 +01:00
go.sum Update dependencies 2025-08-18 11:46:23 +01:00
gopher.png Update README.md 2025-10-18 15:38:42 -04:00
Justfile Add build date to test dns 2025-10-19 16:31:12 -04:00
LICENSE Initial commit 2025-06-03 18:07:28 -04:00
main.go Clean up a little 2025-10-19 16:16:52 -04:00
README.md Clean up a little 2025-10-19 16:16:52 -04:00
test.go Add build date to test dns 2025-10-19 16:31:12 -04:00
TODO.md Clean up a little 2025-10-19 16:16:52 -04:00
util.go Ensure block list forever and don't print resolve error 2025-08-08 23:29:24 +01:00

DNS over HTTPS Black Hole

Tiny secure DNS resolver with block list in Go

Uses https://quad9.net and StevenBlack/hosts

Motives:

  • Pi-Hole isn't a single static purego binary
  • DoH required for untrustworthy ISPs
  • UnifiOS sucks

Installation

systemd-resolved

https://wiki.archlinux.org/title/Systemd-resolved

  • Write /etc/systemd/resolved.conf.d/dns_servers.conf

    [Resolve]
    DNS=127.0.0.1
    Domains=~.
    FallbackDNS=
    
  • Replace resolv.conf and enable

    sudo rm -f /etc/resolv.conf
    sudo ln -sf ../run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
    sudo systemctl enable --now systemd-resolved.service
    
  • resolv.conf will probably use 127.0.0.53
    Check using resolvectl and above methods

UniFi OS

  • Build with just buildarm64 and place in /data/doh-hole

  • Copy unifi-os/doh-hole.service
    to /etc/systemd/system/doh-hole.service

  • Enable and start service

    systemctl daemon-reload
    systemctl enable --now doh-hole.service
    systemctl status doh-hole.service
    
  • Make sure encrypted DNS is disabled in settings
    and set DNS under internet to 127.0.53.54