Commands / Services and tunnels

Services and tunnels

rndc

Also bind control, named reload

Controls a running BIND name server: reload a zone, flush its cache, show its status.

rndc talks to named over a control channel (here 127.0.0.1, with a shared key), so a server can take a changed zone without a restart. rndc reload ZONE reads that zone's file again; rndc status shows what it serves. Its counterpart for unbound is unbound-control.

rndc command usage

rndc reload [ZONE]
rndc retransfer ZONE
rndc reconfig
rndc status
rndc flush

Options

reload example.lab
read that zone's file again (all zones without a name)
retransfer corp.lab
on a secondary: copy the whole zone from the primary again
reconfig
read named.conf again, for new options and zones
status
version, zones served, and whether it is running
flush
empty the server's cache (for a resolving BIND)

rndc examples

rndc reload example.lab
Makes BIND serve the zone file as it is now.
rndc status
Shows that named runs and how many zones it serves.

Pitfalls

  • Secondaries copy a zone only when its serial is higher: raise it with every edit. A primary set to work out IXFRs from the file (ixfr-from-differences) refuses to load the edit at all, and says so only in its log.
  • rndc reload answers zone reload queued before loading: errors in the zone show in the server's log, not on screen.

Run it on real machines

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Start with a free account: Google or email, no card.

Open this lab