一個簡單的dns服務器

options {
    listen-on port 53 { any; };
    listen-on-v6 port 53 { any; };
    directory   "/srv/app/named";
    dump-file   "/srv/app/named/data/cache_dump.db";
    statistics-file "/srv/app/named/data/named_stats.txt";
    memstatistics-file "/srv/app/named/data/named_mem_stats.txt";
    recursing-file  "/srv/app/named/data/named.recursing";
    secroots-file   "/srv/app/named/data/named.secroots";
    allow-query     { any; };
        forward only;
        forwarders { 1.2.4.8; 180.76.76.76; 114.114.114.114; 192.168.59.241; };
    recursion  yes;
        max-cache-ttl  600;
        max-ncache-ttl 600;
        version "[no version.]";
        minimal-responses yes;
    dnssec-enable  no;
    dnssec-validation  no;
    bindkeys-file "/etc/named.iscdlv.key";
    managed-keys-directory "/srv/app/named/dynamic";
    pid-file "/run/named/named.pid";
    session-keyfile "/run/named/session.key";
};


logging {
    channel defaults {
        file "/srv/logs/named/default.log";
        severity dynamic;
        print-time yes;
        print-category yes;
        print-severity yes;
    };
    channel securitys {
        file "/srv/logs/named/securitys.log";
        severity dynamic;
        print-time yes;
        print-category yes;
        print-severity yes;
    };
    channel gsquery {
        file "/srv/logs/named/query.log"   versions 3 size 5m;
        severity error;
        print-time yes;
        print-category yes;
        print-severity yes;
    };
    category queries { gsquery; };
    category security { securitys; };
    category default { defaults; };
    category general { defaults; };
};

zone "." IN {
    type hint;
    file "named.ca";
};

include "/etc/named.ntp.zones";
include "/etc/named.tophc.zones";
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
$ORIGIN tophc.top.
$TTL 120
@       IN SOA ns1.tophc.top. 1@3.com. (
            2019052810 ; serial
            21600 ; refresh
            3600 ; retry
            604800 ; expiry
            120 ; minimum ttl
        )

; Nameservers

tophc.top.  86400 IN NS  ns1.tophc.top.
tophc.top.      86400 IN TXT "v=spf1 include:tophc.top -all"
       
; Mailservers
tophc.top.  86400 IN MX  10  mail.xxxx.xxxx.
mail            120   IN A   xxxx

; Reverse DNS Records (PTR)

; CNAME
smtp    120 IN CNAME mail
imap    120 IN CNAME mail
pop3    120 IN CNAME mail


; DNS RECORDS
ns1 120 IN A xxxx
; HOST RECORDS
ftp 120 IN A xxxx
相關文章
相關標籤/搜索