Tags

Here’s a concise BIND9 Dynamic Zone Management Cheat Sheet to handle common tasks and troubleshoot dynamic zones:

BIND9 Dynamic Zone Management Cheat Sheet

Freezing and Thawing Zones

  • Freeze a zone (disable dynamic updates):
 
  • rndc freeze <zone>
  • Thaw a zone (enable dynamic updates):
 
  • rndc thaw <zone>

Reloading a Zone

  • Reload a zone (after freeze):
 
  • rndc reload <zone>

Fixing Journal Issues

  1. Freeze the Zone:
  • rndc freeze <zone>
  • Delete the Journal File:
  • rm /etc/bind/zones/<zone>.jnl
  • Verify the Zone File:
  • named-checkzone <zone> /etc/bind/zones/<zone>.db
  • Reload the Zone:
  • rndc reload <zone>
  • Thaw the Zone:
  1. rndc thaw <zone>

Viewing Zone Status

  • Check if a zone is loaded:
  • rndc status
  • List loaded zones:
  • rndc showzone

Debugging

  • View BIND logs:
  • tail -f /var/log/named/*.log
  • Check zone file syntax:
  • named-checkzone <zone> /etc/bind/zones/<zone>.db
  • Check configuration file syntax:
  • named-checkconf

Managing Configuration Files

  • Primary zone example (named.conf.local):
  • zone "example.com" {    type master;    file "/etc/bind/zones/db.example.com";    allow-update { key ddns-key; }; };
  • Dynamic updates key example:
  • key "ddns-key" {    algorithm hmac-sha256;    secret "base64-encoded-key"; };

Restarting BIND

  • Reload configuration:
  • rndc reload
  • Restart BIND9 service:
  • systemctl restart bind9

Common File Paths

  • Zone files: /etc/bind/zones/<zone>.db
  • Journal files: /etc/bind/zones/<zone>.jnl
  • Logs: /var/log/named/*.log
  • Config files: /etc/bind/named.conf, /etc/bind/named.conf.local

Quick Tips

  • Always freeze a dynamic zone before editing its .db file manually.
  • Use named-checkzone and named-checkconf to validate changes before applying.
  • Backup your zone files and journal files regularly.