Debian DNS服务

DNS服务

安装DNS

apt-get install bind9

添加区域配置

vim /etc/bind/named.conf.local

zone "skills.com" {

        type master;

        file "/etc/bind/db.skills.com";

};

zone "0.168.192.in-addr.arpa" {

        type master;

        file "/etc/bind/db.0.168.192";

};

添加正向解析

cp db.local db.skills.com
vim /etc/bind/db.skills.com

$TTL    604800

@   IN  SOA skills.com. admin.skills.com. (

                  2     ; Serial

             604800     ; Refresh

              86400     ; Retry

            2419200     ; Expire

             604800 )   ; Negative Cache TTL

;

@   IN  NS  ns.skills.com.

@   IN  A   192.168.0.113

www  IN  A   192.168.0.113

添加反向解析

cp db.127 db.0.168.192
vim /etc/bind/db.0.168.192

$TTL    604800

@   IN  SOA skills.com. admin.skills.com. (

                  1     ; Serial

             604800     ; Refresh

              86400     ; Retry

            2419200     ; Expire

             604800 )   ; Negative Cache TTL

;

@   IN  NS   ns.skills.com.

www IN  PTR  www.skills.com.

重启dns

systemctl restart bind9

测试

Nslookup  www.skills.com #正向解析

Nslookup  192.168.0.113 #反向解析


版权声明:本文为m0_49614204原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。