GoBLDNSD Operator Manual
GoBLDNSD is a high-performance Go DNSBL daemon (gobldnsd.com). © 2026 Threat InSites Inc DBA EmailAbuse.Net Licensed under the GNU Affero General Public License v3.0 (AGPLv3).
New to GoBLDNSD? Start with the Quick Start Guide to build, configure, and run your first zone in under a minute.
Signals & Process Management
GoBLDNSD handles standard POSIX signals for zero-downtime administration:
-
SIGHUP: Triggers a seamless hot-reload. The daemon iterates through the configured zones, reloads modified dataset files into memory, and swaps the active pointers atomically without dropping queries. If logging or statistics are enabled,SIGHUPalso reopens the query log file (forlogrotatecompatibility) and dumps current statistics. -
SIGUSR1: Immediately dumps current query statistics to the file configured in thestatssection without reloading datasets. -
SIGINT/SIGTERM: Initiates a graceful shutdown. The daemon stops accepting new packets, finishes processing the current batch, flushes any pending query logs and statistics to disk, and removes thepid_filebefore exiting.
Command Line Options
There is only one command line option—the location of the YAML configuration file:
gobldnsd config_file.yaml
Default configuration file location: /etc/gobldnsd/gobldnsd.yaml
Configuration
The configuration for GoBLDNSD is driven entirely by a single YAML file. This file defines the network listener, telemetry, global filtering rules, and authoritative zones.
Minimal Example
# gobldnsd.yaml
zones:
- name: ip.blocklist.example.com
datasets:
- type: ip4set
files: /var/data/zones/ip4_listings.dnsbl
This example loads the dataset at /var/data/zones/ip4_listings.dnsbl and serves
it within the zone ip.blocklist.example.com. You would query an IP address in
this zone as 2.0.0.127.ip.blocklist.example.com.
Top-Level YAML Configuration (Optional)
| Parameter | Type | Default | Description |
|---|---|---|---|
listen |
String or List | — | IP address(es) and UDP port(s) to bind to (e.g., "0.0.0.0:53", "127.0.0.1:53"). |
pid_file |
String | /var/run/gobldnsd.pid |
Path where the daemon writes its Process ID on startup for init/logrotate scripts. |
workers |
Integer | All CPU cores | Number of concurrent packet worker goroutines/sockets to spawn. |
reload_timer |
Duration | — | How frequently dataset files on disk are checked for modifications (e.g., "5s", "1m"). |
base_domain |
String | — | Base authoritative domain applied to all zones (e.g., "example.com" serves zone "blocklist" as "blocklist.example.com"). Overridable per zone. |
dataset_dir |
String | — | Base directory for dataset files (e.g., "/var/data/zones/"). Extendable or overridable per zone. |
normalize_txt |
Boolean | false |
Enables TXT record normalization on load using $ macros to reduce memory overhead. Overridable per zone/dataset. |
ns |
String or List | — | Default Nameserver (NS) records returned on explicit NS queries. Overridable per zone or via $NS. |
soa |
String | Auto-generated | Default 7-field SOA record returned on SOA queries and negative responses. Overridable per zone or via $SOA. |
ttl |
Integer / Duration | 300 (5m) |
Positive (listed) record TTL. Overridable per zone or via $TTL. |
ttl_soa |
Integer / Duration | 3600 (1h) |
TTL for authoritative SOA and NS records. Overridable per zone or via $TTL_SOA. |
ttl_nxdomain |
Integer / Duration | 3600 (1h) |
Negative caching TTL applied to SOA on NXDOMAIN responses (including whitelist hits). Falls back to SOA MinTTL. |
ttl_nodata |
Integer / Duration | ttl_nxdomain |
Negative caching TTL applied to SOA on NODATA and partial matches. |
Logging and Statistics (Optional)
GoBLDNSD includes lock-free, per-worker query logging and zone statistics designed to
operate without blocking packet workers or inducing cross-core cache contention. Both
output formats are compatible with legacy rbldnsd parsers and monitoring
scripts.
log:
enabled: false
file: /var/log/gobldnsd/query.log
flush_immediate: false
buffer_entries: 4096
stats:
enabled: true
file: /var/log/gobldnsd/stats.log
interval: 60s
reset_on_dump: false
append: true
log Block Options
enabled: (Boolean) Enables or disables per-query logging. Defaults tofalse.file: (String) Destination path for the query log, or"stdout"/"-"for standard output. Reopened automatically upon receivingSIGHUP(unless writing to stdout).flush_immediate: (Boolean) Whentrue, flushes buffered log lines immediately to disk after each batch; whenfalse(default), buffers up to 64KB or 250ms to minimize I/O syscalls.buffer_entries: (Integer) Per-worker SPSC ring buffer capacity (rounded up to a power of 2; defaults to4096slots per worker). If a disk stalls and a ring fills, new log entries are dropped rather than stalling DNS packet workers.
Query Log Format (rbldnsd compatible):
<timestamp> <client_ip> <qname> <qtype> <qclass>: <result> <bytes>
stats Block Options
enabled: (Boolean) Enables per-zone query counter tracking. Defaults tofalse.file: (String) Destination path for statistics dumps, or"stdout"/"-". Safely supports named pipes (FIFOs) viaO_NONBLOCK.interval: (Time Quantifier) Optional periodic dump interval (e.g.,"60s","5m"). If omitted, statistics are only written whenSIGUSR1,SIGHUP, or shutdown occurs.reset_on_dump: (Boolean) Whenfalse(default), counters are cumulative since daemon start (equivalent torbldnsd -s file). Whentrue, counters reset to zero on each dump (equivalent torbldnsd -s +file).append: (Boolean) Whentrue, new stats lines are appended to the file. Whenfalse, the file is atomically replaced with the latest single-line snapshot on each dump.
Statistics Format (rbldnsd compatible):
<timestamp> <zone1>:<ok>:<nxd>:<err> <zone2>:<ok>:<nxd>:<err> ... *:<total_ok>:<total_nxd>:<total_err>
SOA (Start of Authority) Record Options
SOA records are generated automatically by default. To configure exact SOA parameters, specify a 7-field string:
soa: "ns1.example.com hostmaster.example.com 2026103101 28800 2h 7d 86400"
| Field | Example | Description |
|---|---|---|
| MName | ns1.example.com |
Primary nameserver |
| RName | hostmaster.example.com |
Hostmaster email, with . instead of @ |
| Serial | 2026103101 |
Version number (or "0", "epoch", "date") |
| Refresh | 28800 (8 hours) |
Time before secondary nameservers check for updates |
| Retry | 2h (7200s) |
Time before retrying a failed refresh |
| Expire | 7d (604800s) |
Time before secondary nameservers stop responding |
| MinTTL | 86400 (1 day) |
Default negative cache TTL (RFC 2308) |
SOA record itself is controlled via
ttl_soa or $TTL_SOA. Legacy 8-field SOA strings with a leading
inline TTL are accepted for backward compatibility, but the inline TTL is ignored with a
warning.
To generate the serial number automatically based on dataset modification times, use
"0", "epoch", or "date" as the Serial token:
soa: "ns1.example.com hostmaster.example.com 0 28800 7200 604800 86400"
soa: "ns1.example.com hostmaster.example.com epoch 28800 7200 604800 86400"
soa: "ns1.example.com hostmaster.example.com date 28800 7200 604800 86400"
"0"or"epoch": Sets the SOA serial to the Unix epoch timestamp of the newest dataset in the zone."date": Generates aYYYYMMDDNNserial and automatically incrementsNN(00–99) across hot-reloads on the same UTC day.
Configuration File Sections
filters: (Block) Optional. Universal access control lists (acl/aclkey) and whitelists applied before any zone processing occurs.export: (Block) Optional. Datasets shared between multiple zones are defined here once in memory.zones: (Array) REQUIRED. A list of authoritative zones hosted by this instance.
The filters Section (Optional)
Define global security policies applied before zone routing. When a global
aclkey is configured in filters, the key sits at the label
immediately preceding base_domain:
<query>.<zone>.<global-aclkey>.<base-domain>.
filters:
whitelists:
- type: ip4set
files: whitelisted_ip4_zone.dnsbl
datasets:
- type: acl
files: global_acl_policy.dnsbl
- type: aclkey
files: customer_keys.dnsbl
The export Section (Optional)
Load shared datasets once in memory in the export section and attach them to
multiple zones via import:
export:
whitelists:
- name: shared-ip-whitelist
type: ip4set
files: shared_ip_whitelist.dnsbl
datasets:
- name: shared-ip4s
type: ip4set
files: shared_ip4.dnsbl
zones:
- name: ip
whitelists:
- import: shared-ip-whitelist
datasets:
- import: shared-ip4s
The zones Section (Required)
Authoritative zones are defined and populated with datasets here, natively supporting multi-tenant hosting within a single daemon instance.
name: (String) Required. Relative selector for the zone (e.g.,"ip"), or full zone name ifbase_domainis empty.base_domain: (String) Overrides globalbase_domainfor this zone.dataset_dir: (String) Relative paths extend globaldataset_dir(e.g.,"zones"becomes"/var/data/zones/"), while leading/paths override it completely.normalize_txt,ns,soa,ttl,ttl_soa,ttl_nxdomain,ttl_nodata: Zone-level overrides for top-level settings.whitelists: List of whitelist datasets bound to this zone.datasets: List of data feeds (including zone-levelacloraclkeydatasets) bound to this zone.
zones:
- name: ip.blocklist.example.com
datasets:
- type: ip4trie
files: listed_ip4_cidrs.dnsbl
- import: shared-ip4s # Imported from "export" section
Datasets & Whitelists
Each dataset entry accepts:
name: Optional internal reference name (not part of the DNS query name).type: One of the supported dataset types below.files: One or more dataset files to load (natively supports.gzand.zstcompression).normalize_txt: Optional dataset-level override.
| Type | Description |
|---|---|
ip4set |
Sorted set of IPv4 CIDR/range entries with responses and optional IPv4 exclusion ranges. |
ip4trie |
Prefix trie holding IPv4 CIDR ranges with varying or bitmapped responses. |
ip4tset |
Compact flat list of individual /32 IPv4 addresses sharing a single response value. |
ip6set |
Sorted set of IPv6 CIDR/range entries with responses and optional IPv6 exclusion ranges. |
ip6trie |
Prefix trie holding IPv6 CIDR ranges with varying or bitmapped responses. |
ip6tset |
Compact list of IPv6 network prefixes (/64 to /1, defaulting to /64) with a shared response and optional /128 exclusions. |
dnset |
Domain dataset with individual responses; supports exact, *. (subdomains only), and . (domain + subdomains) wildcards, with native RFC-compliant QNAME minimization (ENT). |
hashset |
Cryptographic or arbitrary hashes stored in packed binary format with individual responses. |
acl |
Specialized IPv4/IPv6 trie evaluating client IP access policies. |
aclkey |
Customer authorization keys restricting zone access: <query>.<aclkey>.<zone>.<base-domain>. |
combined |
Multi-type dataset file using $DATASET directives to mix multiple dataset types (e.g., ip4set, ip6set) in a single file. |
Whitelists
Whitelists act as a high-speed bypass layer to prevent false positives for critical
infrastructure. Any dataset loaded inside a whitelists block
must contain the $WHITELIST directive.
When a query matches a whitelist, GoBLDNSD skips querying threat datasets and immediately
returns NXDOMAIN. Whitelists also accept a $TTL directive to
override the negative caching TTL in the SOA record.
Dataset Formats
Datasets are plain text files (or .gz / .zst archives) parsed
sequentially. Blank lines and lines starting with # or ; are
ignored.
Set the default A and TXT response for subsequent lines using a leading colon (:):
:127.0.0.2:IP is listed in the blocklist
192.0.2.1
192.0.2.2
Override the response for a single entry inline, or omit 127 in shorthand
notation (:0.0.3 or :3 expands to 127.0.0.3):
192.0.2.5 :127.0.0.3:Custom text just for this IP
Exclude sub-ranges with a leading exclamation point (!):
!192.0.2.128/25
IPv6 Usage: Because IPv6 addresses contain colons, wrap the address in brackets or leave whitespace before the response colon:
2001:db8:85a3::8a2e:0370:4 :response
[2001:db8:85a3::8a2e:0370:4]:response
[2001:db8:85a3::8a2e:0370:4] :response
Combined Datasets: A combined dataset lets you mix multiple dataset types in a single file using the $DATASET <type>[:name] directive. Multiple $DATASET blocks of the same type are automatically merged into a single dataset before finalization, and the default :A:TXT response resets on each $DATASET switch.
$SOA ns1.example.com hostmaster.example.com 0 28800 7200 604800 300
$1 https://example.com/lookup?q=
$DATASET ip4set:spam
:127.0.0.2:IP $ listed at $1$
192.0.2.1
$DATASET dnset:domains
:127.0.0.4:Domain $ listed at $1$
bad.example.org
Bitmapped Return Values
Return values can be specified as hexadecimal bitmasks (e.g., :0x0020). When
multiple entries or datasets match, GoBLDNSD bitwise-ORs them together into a single
synthesized 127.X.X.X A record:
datasets:
- type: ip4trie
files:
- spam_ips.dnsbl # returns :0x000004
- phish_ips.dnsbl # returns :0x000080
- malware_ips.dnsbl # returns :0x000100
An IP listed in all three files returns a single A=127.0.1.132 (0x7F000184).
ACL Dataset Return Values
acl datasets evaluate the querying client IP rather than the QNAME target. In
addition to normal IP/bitmapped responses, ACLs support four policy actions:
:pass: Fall through the ACL and allow normal zone evaluation.:ignore: Silently drop the UDP query without responding.:refuse: Return a DNSREFUSEDresponse.:empty: ReturnNXDOMAINimmediately, hiding all zone data.
Dataset Directives
Directives can begin with $, #$, :$, or ;$:
$DATASET: Switches the active sub-dataset type inside acombineddataset ($DATASET ip4setor$DATASET ip4set:name).$TTL: Record TTL (or negative caching TTL on whitelists).$MAXRANGE4/$MAXRANGE6: Safety cap on maximum CIDR prefix size (e.g.,$MAXRANGE4 /24,$MAXRANGE6 /48).$WHITELIST: Marks a file as a whitelist dataset.$HASH_ENCODING/$HASH_LENGTH: Configureshashsetencoding (base16orbase32) and fixed character length.$KEY_ENCODING/$KEY_LENGTH/$NOKEY: Configuresaclkeyencoding (ascii,base10,base16,base32), fixed length, and fallback action when no key is supplied.- Zone-Level Directives (inside non-whitelist datasets):
$SOA,$NS,$TTL,$TTL_SOA,$TTL_NXDOMAIN,$TTL_NODATA. - Deprecated
rbldnsdDirectives:$INCLUDE,$TIMESTAMP, and$ENTare ignored with logged deprecation notices.
Dataset Macros
$: Replaced at query time with the matched query target ("$ is listed in this zone").$.: Replaced at query time with the matched zone name.$0–$9: User-defined substitution variables ($0 text...or$0=text...). Expanded at load time, can be redefined or cleared (with an empty$0), and persist across$DATASETblocks within acombinedfile. Undefined or cleared$0–$9macros are stripped.$$: Escaped literal$.
$0 is listed. For removal, visit
$1 https://example.com/lookup?ip=
:127.0.0.2:The IP address $ $0 $1$
192.0.2.1
192.0.2.2
System Tuning & Deployment
Kernel Settings
/etc/sysctl.d/99-gobldnsd.conf:
# Maximize UDP receive and transmit buffers (32MB)
net.core.rmem_max = 33554432
net.core.wmem_max = 33554432
net.core.rmem_default = 33554432
net.core.wmem_default = 33554432
# Increase packet backlog and ancillary buffer size
net.core.netdev_max_backlog = 10000
net.core.optmem_max = 20480
sudo sysctl --system
NIC Ring Buffers
ip link show up
ethtool -g eno1
sudo ethtool -G eno1 rx 4096 tx 4096
To persist ring buffer sizes across reboots (/etc/systemd/network/50-eno1.link):
[Match]
OriginalName=eno1
[Link]
RxBufferSize=4096
TxBufferSize=4096
sudo update-initramfs -u
sudo udevadm control --reload-rules
sudo udevadm trigger
gobldnsd.service
/etc/systemd/system/gobldnsd.service:
[Unit]
Description=GoBLDNSD - High Performance DNSBL Daemon
After=network.target
[Service]
User=gobldnsd
Group=gobldnsd
AmbientCapabilities=CAP_NET_BIND_SERVICE
ExecStart=/usr/local/bin/gobldnsd /etc/gobldnsd/gobldnsd.yaml
ExecReload=/bin/kill -HUP $MAINPID
KillSignal=SIGTERM
TimeoutStopSec=10
SuccessExitStatus=0
Restart=on-failure
[Install]
WantedBy=multi-user.target
Setup & Management Commands:
sudo useradd -r -s /usr/sbin/nologin -d /var/lib/gobldnsd gobldnsd
sudo mkdir -p /etc/gobldnsd /var/lib/gobldnsd /var/log/gobldnsd
sudo chown -R gobldnsd:gobldnsd /etc/gobldnsd /var/lib/gobldnsd /var/log/gobldnsd
sudo systemctl daemon-reload
sudo systemctl enable --now gobldnsd.service
# Trigger hot-reload (SIGHUP) or on-demand stats dump (SIGUSR1)
sudo systemctl reload gobldnsd.service
sudo systemctl kill -s USR1 gobldnsd.service
logrotate: In your logrotate postrotate script for /var/log/gobldnsd/query.log:
systemctl reload gobldnsd.service
# or: systemctl kill -s HUP gobldnsd.service
Migrating from rbldnsd
GoBLDNSD includes convert.py to translate legacy rbldnsd flags,
startup scripts, and systemd unit files directly into gobldnsd.yaml:
# Method 1: Pass rbldnsd command-line flags directly
python3 convert.py -r /var/lib/rbldnsd -b 127.0.0.1/53 ipfile.dnsbl:ip4set:ipzone > gobldnsd.yaml
# Method 2: Parse a text file of options (defaults to rbldnsd.txt)
python3 convert.py rbldnsd.txt > gobldnsd.yaml
# Method 3: Parse an existing /etc/default/rbldnsd or systemd service file
python3 convert.py /etc/default/rbldnsd > gobldnsd.yaml
python3 convert.py /etc/systemd/system/rbldnsd.service > gobldnsd.yaml
Artwork & Trademark Notice
The GoBLDNSD logo is derived from the Go gopher, originally designed by Renée French and licensed under Creative Commons 4.0 Attribution (CC BY 4.0).
GoBLDNSD is an independent project and is not affiliated with, endorsed by, or an official release of Google or the Go project.