Up and Running with GoBLDNSD
GoBLDNSD compiles to a single static binary with zero runtime dependencies. Follow these
steps to build the daemon, serve a test DNSBL zone locally, and verify queries with
dig.
1. Prerequisites
- Linux (
amd64/arm64) - Go 1.26 or newer (for building from source)
dig(dnsutils/bind-utils) for testing
2. Download & Build
Clone the repository and compile the binary:
git clone https://github.com/your-org/gobldnsd.git
cd gobldnsd
go build -o gobldnsd ./cmd/gobldnsd
Optionally install it system-wide:
sudo install -m 755 gobldnsd /usr/local/bin/gobldnsd
CAP_NET_BIND_SERVICE via systemd (AmbientCapabilities=CAP_NET_BIND_SERVICE)
or directly on the binary with
sudo setcap cap_net_bind_service=+ep /usr/local/bin/gobldnsd.
3. Create Your First Dataset & Config
Create a sample IPv4 blocklist dataset (ip4_listings.dnsbl):
cat <<'EOF' > ip4_listings.dnsbl
:127.0.0.2:IP $ is listed in bl.example.org
127.0.0.2
192.0.2.0/24
!192.0.2.10
EOF
Create a minimal gobldnsd.yaml listening on an unprivileged test port (127.0.0.1:5353):
cat <<'EOF' > gobldnsd.yaml
listen: "127.0.0.1:5353"
zones:
- name: ip.bl.example.org
datasets:
- name: ip4_listings
type: ip4set
files: ./ip4_listings.dnsbl
EOF
4. Run & Verify with dig
Start GoBLDNSD pointing at your YAML file:
./gobldnsd gobldnsd.yaml
In a second terminal, query the standard DNSBL test address (127.0.0.2 reversed) and an excluded address:
# Listed IP -> returns 127.0.0.2 + TXT
dig @127.0.0.1 -p 5353 +short 2.0.0.127.ip.bl.example.org A
dig @127.0.0.1 -p 5353 +short 2.0.0.127.ip.bl.example.org TXT
# Excluded IP (192.0.2.10) -> returns NXDOMAIN
dig @127.0.0.1 -p 5353 10.2.0.192.ip.bl.example.org A
5. Test Zero-Downtime Hot-Reload
Append a new IP to ip4_listings.dnsbl and send SIGHUP. GoBLDNSD
parses the updated file in the background and swaps pointers atomically without dropping
packets:
echo "198.51.100.42" >> ip4_listings.dnsbl
kill -HUP $(pgrep gobldnsd)
dig @127.0.0.1 -p 5353 +short 42.100.51.198.ip.bl.example.org A
Next Steps
- Migrating an existing server? Use
convert.pyto translate your existingrbldnsdflags or systemd unit into YAML → Migration Guide. - Production deployment? Configure UDP buffer sizes, NIC ring buffers, and systemd → System Tuning & Deployment.
- Full reference: Explore
filters, sharedexportdatasets,dnset,hashset, and bitmapped responses → Operator Manual.