`
cocoIT
  • 浏览: 48459 次
  • 性别: Icon_minigender_1
  • 来自: 福建
文章分类
社区版块
存档分类
最新评论

在ubuntu 12.04上搭建简单的DNS服务器

 
阅读更多
1. 安装bind9: apt-get install bind9;
2. /etc/bind/上创建db.192.0.1和db.test.com文件:
db.192.0.1文件内容如下:


$TTL 604800
@ IN SOA test.com. root.test.com. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS test.com.
141 IN PTR test.com.
140 IN PTR aaa2.test.com.


db.test.com文件内容如下:
$TTL 604800
@ IN SOA test.com. root.test.com. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS test.com.
@ IN A 192.0.1.141
@ IN MX 10 test.com.
aaa2.test.com. IN A 192.0.1.140


3. 在/etc/bind/named.conf.local文件中添加以下内容:
zone "test.com" {
type master;
file "/etc/bind/db.test.com";
};


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




4. 重启DNS服务: service bind9 restart


在测试机中添加本服务器地址,然后用nslookup测试。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics