首页 > 系统服务 > 详细

Ubuntu14.04 bind9配置

时间:2016-12-15 09:20:08      阅读:301      评论:0      收藏:0      [点我收藏+]
apt-get install bind9

配置域名: cn.archive.ubuntu.com
对应IP: 10.60.233.244

vim  /etc/bind/name.conf.default-zones 
在文件后面添加:
zone "archive.ubuntu.com" {
        type master;
        file "/etc/bind/db.archive.ubuntu.com";
};

zone "233.60.10.in-addr.arpa" {
        type master;
        file "/etc/bind/db.10";
};

1、添加正向解析:
vim /etc/bind/db.archive.ubuntu.com
创建文件并添加:
;
; BIND data file for local loopback interface
;
$TTL    604800
@       IN      SOA     ns.archive.ubuntu.com. root.archive.ubuntu.com. (
                              2         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      ns.archive.ubuntu.com.
@       IN      A       10.60.233.244
ns      IN      A       10.60.233.244
cn      IN      A       10.60.233.244

2、添加反向解析:
vim /etc/bind/db.10
创建文件并添加:
;
; BIND reverse data file for local loopback interface
;
$TTL    604800
@       IN      SOA     ns.archive.ubuntu.com. root.archive.ubuntu.com. (
                              1         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      archive.ubuntu.com.
1.0.0   IN      PTR     cn.archive.ubuntu.com.
244     IN      PTR     archive.ubuntu.com.
244     IN      PTR     www.archive.ubuntu.com.
244     IN      PTR     dns.archive.ubuntu.com.
244     IN      PTR     cn.archive.ubuntu.com.

修改 /etc/bind/named.conf.options :
如下设置:
        forwarders {
                8.8.8.8;
                8.8.4.4;
        };

        allow-query { any; };

OK, 重启服务 service bind9 restart  

测试:
root@trait:/etc/bind# nslookup cn.archive.ubuntu.com
Server:         127.0.0.1
Address:        127.0.0.1#53

Name:   cn.archive.ubuntu.com
Address: 10.60.233.244

或者:

root@trait:/etc/bind# host cn.archive.ubuntu.com 10.60.235.100
Using domain server:
Name: 10.60.235.100
Address: 10.60.235.100#53
Aliases: 

cn.archive.ubuntu.com has address 10.60.233.244

Ubuntu14.04 bind9配置

原文:http://www.cnblogs.com/danxi/p/6181855.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!