BIND DNS Server on Debian

48 阅读1分钟
# debian 12
apt update
apt install bind9 dnsutils

mkdir /etc/bind/zones
cp /etc/bind/db.local /etc/bind/zones/db.yourdomain.com

# /etc/bind/zones/db.yourdomain.com

# Finally, test your configuration for syntax errors:
named-checkconf

systemctl start bind9
systemctl enable bind9

rndc dumpdb -cache  # /var/cache/bind/named_dump.db
# /etc/bind/named.conf.options

acl "trusted" {
    192.168.0.0/16;
    localhost;
    localnets;
};

options {
    directory "/var/cache/bind";

    recursion yes;
    allow-query { trusted; };

    forwarders {
        8.8.8.8;
        8.8.4.4;
    };

    dnssec-validation auto;

    listen-on { any; };
    listen-on-v6 { any; };
};

# /etc/bind/named.conf.local

zone "yourdomain.com" {
    type master;
    file "/etc/bind/zones/db.yourdomain.com"; # zone file path
};