For the DNS lookups at home. This works well enough for my home network but shouldn't be used unless you're willing to do some debugging.
- Blocklist for ad / malware blocking.
- Override domains.
- DDNS support.
- Caching forwarding name server.
Standard cargo build --release should give you a binary for your host platform. If you have just installed,
just release is also available.
The home-dns-server executable takes one argument -c path/to/config.toml. See the example-config/config.toml for reference.
Prometheus metrics are available on port 9000 http://host:9000/metrics
If you're running on a Systemd system you can create a home-dns.service file using the following as a template. Be sure to replace
the ExecStart value with your paths and User with whatever user you want to run as. In my case I made a home-dns system
user.
[Unit]
Description=Home DNS
After=network.target
StartLimitIntervalSec=60
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
AmbientCapabilities=CAP_NET_BIND_SERVICE CAP_NET_RAW
TimeoutStartSec=2min
Restart=always
RestartSec=1
User=home-dns
ExecStart=/path/to/home-dns-server -c /path/to/config.toml
[Install]
WantedBy=multi-user.target
For updating the blocklist I have a cron that runs daily like so.
wget -O /usr/local/etc/homedns/pro.txt https://cdn.jsdelivr.net/gh/hagezi/dns-blocklists@latest/hosts/pro.txt
Be sure to update the paths for your environement. The server will check for updates to this file periodically and update the blocklist when the file is updated.
- DDNS implementation isn't all the standards compliant at the moment. It will take whatever update it receives and replace any existing record with it.
- Metrics port is hard coded.
- No ipv6 support for overrides / blocklist.
- Updating overrides requires a restart of the service.
- Upstream servers are hardcoded to Google,Cloudflare and Quad9.