[root@bebepay /]# yum list all |grep "^bind" 查询与bind开头的相关安装包。
yum install bind-* 安装bind包及其相关子包。
[root@bebepay /]# rpm -qa |grep "bind" 查询已经安装的bind包。
[root@bebepay /]# rpm -ql bind 查询bind包安装的路径。
安装完成后,主配置文件在/etc/named.conf中,如:做出如下修;
listen-on port 53 { any; };修改监听端口为任意53,或者修改为自己想要监听的端口。
forwarders {61.128.128.68;};本地电信运营商的dns地址,如果内部无法解析的请求,向该地址转发,可以加多个地址。
allow-query { any; };允许任意地址的请求。
建立正向和反向区域:
zone "tangbo.com" IN { //正向区域
type master;
file "tangbo.com.zone";
allow-update { none; };
};
zone "1.168.192.in-addr.arpa" IN { //反向区域
type master;
file "1.168.192.zone";
allow-update { none; };
建立区域文件:
[root@bebepay named]# ls
1.168.192.zone named.ca slaves
chroot named.empty tangbo.com.zone
data named.localhost
dynamic named.loopback
[root@bebepay named]#
[root@bebepay named]# cat tangbo.com.zone
$TTL 1D
@ IN SOA @ rname.invalid. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
NS @
A 192.168.1.201
AAAA ::1
www IN A 192.168.1.202
bbs IN A 192.168.1.201
[root@bebepay named]#
[root@bebepay named]# cat 1.168.192.zone
$TTL 1D
@ IN SOA bebepaydb.com. rname.invalid. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
NS tangbo.com.
A 127.0.0.1
AAAA ::1
PTR localhost.
201 IN PTR www.tangbo.com.
8.开启DNS服务,输入:service named start
9.chkconfig named on 设置开机启动named服务
10.关闭防火墙,关闭selinux。
本文出自 “夜的博客” 博客,请务必保留此出处http://cqtangbo.blog.51cto.com/2978612/1598841
原文地址:http://cqtangbo.blog.51cto.com/2978612/1598841