赞
踩
1、安装bind9
apt-get bind9
2、bind9简单配置
配置域名 www.test.com
对应IP 41.85.41.1
/etc/bind/named.conf.default-zones 末尾添加如下内容
- zone "test.com" {
- type master;
- file "/etc/bind/db.test.com";
- };
-
-
- zone "41.85.41.in-addr.arpa" {
- type master;
- file "/etc/bind/db.41.85.41";
- };
cp /etc/bind/db.local db.test.com
vi db.test.com
;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA localhost. root.localhost. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS localhost.
www IN A 1.2.3.4
@ IN AAAA ::1
重启bind9服务
service bind9 restart
调试
root@chenjun-OptiPlex-9020:bind# nslookup www.test.com 127.0.0.1
Server: 127.0.0.1
Address: 127.0.0.1#53
Name: www.test.com
Address: 1.2.3.4
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。