标签:centos dns server dns服务器 centos6.5
1,安装软件包
yum install -y bind
2,备份配置文件
cp /etc/named.conf /etc/named.conf_bak
3,编辑配置文件
vim /etc/named.conf
//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
options {
listen-on port 53 { 192.168.0.99; };
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query { any; };
recursion yes;
dnssec-enable yes;
dnssec-validation yes;
dnssec-lookaside auto;
/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";
managed-keys-directory "/var/named/dynamic";
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "." IN {
type hint;
file "named.ca";
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
4,更改/etc/named.rfc1912.zones文件配置(添加正向解析地址)
vim /etc/named.rfc1912.zones
zone "1.0.0.127.in-addr.arpa" IN {
type master;
file "named.loopback";
allow-update { none; };
};
zone "0.in-addr.arpa" IN {
type master;
file "named.empty";
allow-update { none; };
};
zone "dyb.com" IN {
type master;
file "dyb.com.zone";
allow-update { none; };
};
5,在/var/named/目录下创建dyb.com.zone文件
cd /var/named
cp named.localhost dyb.com.zone
vim dyb.com.zone
$TTL 1D
@ IN SOA @ dyb.com. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
NS @
A 127.0.0.1
AAAA ::1
www IN A 192.168.0.99
ch IN A 192.168.0.99
dui IN A 192.168.0.99
fuli IN A 192.168.0.99
game IN A 192.168.0.99
mall IN A 192.168.0.99
movie IN A 192.168.0.99
uh IN A 192.168.0.99
6,更改dyb.com.zone文件的所属主和所属人
chown -R root.name dyb.com.zone
ll /var/name/
总用量 32
drwxrwx--- 2 named named 4096 2月 27 10:05 data
-rw-r----- 1 root named 334 2月 27 10:05 dyb.com.zone
drwxrwx--- 2 named named 4096 2月 27 10:06 dynamic
-rw-r----- 1 root named 2075 4月 23 2014 named.ca
-rw-r----- 1 root named 152 12月 15 2009 named.empty
-rw-r----- 1 root named 152 6月 21 2007 named.localhost
-rw-r----- 1 root named 168 12月 15 2009 named.loopback
drwxrwx--- 2 named named 4096 12月 12 10:25 slaves
7,重启dns服务
/etc/init.d/named restart
标签:centos dns server dns服务器 centos6.5
原文地址:http://szh11.blog.51cto.com/825676/1616896