Linux alinux 2.6.18-164.15.1.el5 #1 SMP Wed Mar 17 11:37:14 EDT 2010 i686 i686 i386 GNU/Linux
drwxr-x--- 4 root named 4096 Dec 17 16:50 .
ta localhost.zone named.ca named.local slaves
localdomain.zone named.broadcast named.ip6.local named.zero
[root@testserver named]# cd ../../etc/
# pwd
/var/named/chroot/etc
# cd ../var/named/
# pwd
/var/named/chroot/var/named
[root@testserver etc]# cp -b named.rfc1912.zones named.rfc1912.zones.bak
[root@testserver etc]# ls
localtime named.caching-nameserver.conf named.rfc1912.zones named.rfc1912.zones.bak rndc.key
[root@testserver etc]# vim named.caching-nameserver.conf any;为更改后的(注意红色部分)
options {
listen-on port 53 {
any; };
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";
query-source port 53;
query-source-v6 port 53;
allow-query {
any; };
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
view localhost_resolver {
match-clients {
any; };
match-destinations {
any; };
recursion yes;
include "/etc/named.rfc1912.zones";
};
[root@testserver named]# cd ../../etc/
---------------------------------------------------------------------------
[root@testserver etc]# cp named.rfc1912.zones named.rfc1912.zones.bak
//定义一个正向域 area.com ,定义正向解析文件名 alinux.net.cn.zone
//定义反向域 ,定义反向解析文件名 10.25.61.zone
[root@testserver etc]# vi named.rfc1912.zones
//test
zone "alinux.net.cn" IN {
type master;
file "alinux.net.cn.zone";
allow-update { none; };
};
zone "61.25.10.in-addr.arpa" IN {
type master;
file "10.25.61.zone";
allow-update { none; };
};
---------------------------------------------------------------------------
# 配置正反向解析文件
---------------------------------------------------------------------------
#cp -p localdomain.zone area.com.zone
#vim alinux.net.cn.zone
$TTL 86400
@ IN SOA root.area.com. (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS
www IN A 10.25.61.32
IN AAAA ::1
---------------------------------------------------------------------------
#cp -p named.local 10.25.61.zone
#vim 10.25.61.zone
$TTL 86400
@ IN SOA root.area.com. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS
32 IN PTR
---------------------------------------------------------------------------
32是指的是IP:10.25.61.32的最后一个数。
配置selinux
[root@testserver etc]# setup
弹出一个对话框。我们要进行的是防火墙配置,步骤如下:
选
择“Firewall Configuration”---按 “Tab”键切换到“Run Tool”—回车—“Security
Level”选项要在“Enabled”前面按一下“Tab”键---“SelLinux”选项要选“Disabled”—按一下“Tab”键---选中
“Customize”---弹出新对话框---在“Other Port”栏目里输入“53:tcp
53:udp”—“OK”—返回上一个对话框—“OK”—对话框自动关闭。配置完成。
启动named
# service named start
# /etc/init.d/named start
测试
C:\Users\alinux>nslookup
服务器: UnKnown
Address: 125.93.88.19
非权威应答:
名称: web.cdn.tomcdn.com
Address: 121.14.51.6
Aliases:
修改配置后记得重启
# service named restart
# /etc/init.d/named restart
把bind设为开机自启动
chkconfig named on 345
这样就可以了