a
一、安装
rpm -ivh bind*
yum -y install bind
vi /etc/hosts
192.168.220.132 www.kunlan.com
192.168.220.133 www.shuli.com
192.168.220.1 www.wenwen.com
win:
c:/windwos/system32/drives/etc/hosts
/etc/resolv.conf
主配置文件 /etc/named.conf
区域配置文件named.rfc1912.zones
缓存文件 /var/named/named.ca
正向域名解析 /var/named/named.hosts
反向域名解析 /var/named/host.rev
主配置文件 /etc/named.conf
listen-on port 53 { 127.0.0.1; }; 改为
listen-on port 53 { any; };
allow-query { localhost; };改为
allow-query { any; };
区域配置文件named.rfc1912.zones
zone "wanggong.com" IN {
type master;
file "wanggong.com.hosts";
};
正向域名解析 /var/named/named.hosts
@ IN SOA server.wanggong.com. root.wanggong.com.(
111111 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
@ IN NS server.wanggong.com.
server.wanggong.com. A 192.168.220.133
www.wanggong.com. A 192.168.220.132
客户端: /etc/resolv.conf
测试
nslookup
server
www.wanggong.com
A域名->IP
NS 授权的域名服务器
@默认的域名服务器
空格 上一个域名
PTR 反向域名解析
IP->域名
windows下实现域名解析
配置windows下域名服务器
nslookup
server
www.wanggong.com
逆向域名解析
修改区域配置文件/etc/named/rfc1912.zones
zone "220.168.192.in-addr.arpa" IN {
type master;
file "wanggong.com.rev";
};
库文件 /var/named/wanggong.rev.
辅DNS
辅助机器上安装bind包
修改主配置文件 /etc/named.conf
zone "wanggong.com" IN {
type slave;
file "slaves/wanggong.com.hosts.slave";
masters{192.168.220.133;};
};
zone "220.168.192.in-addr.arpa" IN {
type slave;
file "slaves/wanggong.com.rev.slave";
masters{192.168.220.133;};
};