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测试。
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测试。