BIND9 — DNS server
Running your own DNS — zones, records, config checks, resolving debug.
Cheat sheet
4 commands Printable version-
named-checkconfcheck named.conf syntax -
named-checkzone example.com /etc/bind/db.example.comcheck a zone (BEFORE reload) -
sudo rndc reloadapply (or systemctl reload named) -
dig @localhost www.example.comask your own server - don't forget to bump the serial in the SOA when you edit a zone!
Overview
BIND9 is the most common DNS server. It is run for your own zone (an
authoritative server) or as a caching resolver. The service is named
(package bind9); for the client side, see dns-resolv.
Configuration
The config is /etc/bind/named.conf*; zone files usually live in /etc/bind/db.*.
Every time you edit a zone, bump the serial (the number in the SOA) — otherwise secondary servers and caches won't pick up the change.
Recipes
1Troubleshooting
4The server doesn't answer queries
Run named-checkconf (any errors?), check the service is active, listening on
53 (ss -tulnp), and the port is open in firewall (53/udp and 53/tcp).
Confirm dig @IP reaches it.
I changed a zone — still old data
You didn't bump the serial in the SOA, or didn't reload (rndc reload).
Also the TTL: until it expires, caches keep the old data.
SERVFAIL
An error in the zone (named-checkzone), a broken delegation, or DNSSEC.
Check journalctl -u named.
It only resolves locally
Check allow-query / listen-on in named.conf.options — is it listening on
the right address and letting clients in.
See also
- dns-resolv — How a name becomes an IP — resolv.conf, systemd-resolved, /etc/hosts, dig.
- firewall — Traffic filtering — simple ufw and low-level nftables.
- journalctl — Reading the systemd journal (journald) — filters by service, time, priority.
Found an inaccuracy? Report an error in the article