Skip to main content



This cheat sheet provides a quick reference for some common BIND (Berkeley Internet Name Domain) DNS server commands and concepts. BIND is an open-source DNS server software used to manage and resolve domain names on the Internet.


To use BIND, you need to install it on a server. Installation methods vary depending on your operating system. Refer to the official BIND documentation for installation instructions.

BIND Concepts

Zone Files

Zone files contain DNS records for a specific domain or zone.

  • Create a forward zone file for a domain:
    $TTL 1D
    @ IN SOA (
    2022010101 ; Serial
    1H ; Refresh
    15M ; Retry
    1W ; Expire
    1D ; Minimum TTL
    @ IN NS
    @ IN NS
    @ IN A
    www IN A

Zone Types

BIND supports various zone types, including forward and reverse zones.

  • Define a forward zone in named.conf:
    zone "" {
    type master;
    file "/etc/bind/zones/";

Configuration Files

BIND's configuration is defined in various configuration files:

  • named.conf: Main configuration file.
  • named.conf.options: DNS server options.
  • named.conf.local: Local zones.
  • named.conf.default-zones: Default zones.

DNS Records

BIND supports various DNS record types, including A, AAAA, CNAME, MX, and PTR records.

  • Create an MX record in a zone file:
    @       IN      MX      10


Views allow you to serve different DNS data based on client IP addresses or ACLs.

  • Define a view in named.conf:
    view "external" {
    match-clients { any; };
    recursion no;
    zone "" {
    type master;
    file "/etc/bind/zones/";

BIND Command-Line

  • Check BIND configuration for errors:

    named-checkconf /etc/bind/named.conf
  • Start BIND:

    sudo systemctl start bind9
  • Stop BIND:

    sudo systemctl stop bind9
  • Restart BIND:

    sudo systemctl restart bind9
  • Reload BIND configuration:

    sudo systemctl reload bind9
  • Query DNS records using dig:

    dig A


This cheat sheet covers some common BIND DNS server commands and concepts. BIND is a versatile DNS server software for managing domain name resolution; refer to the official BIND documentation for more in-depth information and advanced usage.