#
# /etc/named.conf
#
# This is a configuration file for the name server BIND 9.


#include "/etc/bind/bind.keys";

options {

    version none;
    hostname none;
    server-id none;

    directory "/etc/bind/db";
#    directory "/var/cache/bind";
    managed-keys-directory "/etc/bind/managed-keys";

    listen-on port 53 { any; };
    listen-on-v6 { none; };

    allow-notify { none; };
    allow-query { any; };
    allow-recursion { none; };
    allow-transfer { any; };

    notify no;
    recursion no;
    //========================================================================
    // If BIND logs error messages about the root key being expired,
    // you will need to update your keys.  See https://www.isc.org/bind-keys
    //========================================================================
    dnssec-validation auto;

    auth-nxdomain no;    # conform to RFC1035
};


logging {

    channel log_all { file "/var/log/bind/all-info"; print-time yes; severity info; };
    channel log_all_warnings { file "/var/log/bind/all-warn"; print-time yes; severity warning; };
    channel log_all_errors { file "/var/log/bind/all-err"; print-time yes; severity error; };

    channel log_security { file "/var/log/bind/security"; print-time yes; };
    channel log_queries { file "/var/log/bind/queries"; print-time yes; };
    channel log_clients { file "/var/log/bind/clients"; print-time yes; };
    channel log_updates { file "/var/log/bind/updates"; print-time yes; };
    channel log_zonemsg { file "/var/log/bind/zonemsg"; print-time yes; };
    channel log_unmatched { file "/var/log/bind/unmatched"; print-time yes; };

    category general { log_all; log_all_warnings; log_all_errors; };
    category queries { log_queries; };
    category client { log_clients; };
    category update { log_updates; };
    category update-security { log_updates; };
    category xfer-in { log_zonemsg; };
    category xfer-out { log_zonemsg; };
    category notify { log_zonemsg; };
    category security { log_security; };
    category default { log_all; log_all_warnings; log_all_errors; };
    category unmatched { log_unmatched; };
};


view "local" {

    match-clients { localhost; };

    allow-notify { none; };
    allow-query { any; };
    allow-recursion { any; };
    allow-transfer { any; };

    notify yes;
    recursion yes;

#    forwarders { 217.77.52.252; 217.77.53.237; }; # Old IntelTeck configuration

    # root and localhost zones

    zone "." {
        type hint;
        file "root.hint";
    };

    zone "localhost" {
        type master;
        file "master/localhost.zone";
    };

    zone "127.in-addr.arpa" {
        type master;
        file "master/127.rev";
    };

    zone "0.in-addr.arpa" {
        type master;
        file "master/0.rev";
    };

    zone "255.in-addr.arpa" {
        type master;
        file "master/255.rev";
    };

    # main zones
    include "/etc/bind/named.conf.zone";
};


view "outer" {

    match-clients { any; };
# 194.87.111.74
    zone "111.87.194.in-addr.arpa" {
        type master;
        file "master/111.87.194.rev";
    };

    # main zones
    include "/etc/bind/named.conf.zone";
};
