RedHat CentOS搭建DNS服务器正向解析[服务器安全]
本文“RedHat CentOS搭建DNS服务器正向解析[服务器安全]”是由七道奇为您精心收集,来源于网络转载,文章版权归文章作者所有,本站不对其观点以及内容做任何评价,请读者自行判断,以下是其具体内容:
以下是基于RedHat 5或CentOS系统的正向解析(IP192.168.1.2域名为www.linuxidc.com)为保证建立成功请不要错过任何一个步骤,以下所写是具体步骤挨个履行号令也能保证成功!(反向解析步骤请参考下篇)
一.安装相关软件包:为保证顺利举行请按步骤先删除再重新安装全部软件包
[root@server ~]# rpm -qa | grep bind //查看bind相关软件包
[root@server ~]# rpm -e `rpm -qa | grep bind` --nodeps //删除相关软件包
[root@server ~]# mount /dev/cdrom /media/ //将系统光盘挂载到/media/
[root@server media]# cd /media/Server/ //进入/media/Server/目录
[root@server Server]# rpm -vih bind-* //再次安装相关软件包
[root@server Server]# rpm -vih caching-nameserver-9.3.3-7.el5.i386.rpm
[root@server Server]# service named start //重启named服务
二.改正主配置文件
[root@server Server]# cd /var/named/chroot/etc/ //进入/var/named/chroot/etc/目录
[root@server etc]# vim named.caching-nameserver.conf //改正主配置文件
----------------------------------------------------------------------
options {
listen-on port 53 { any; }; //改正成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; }; //改正成any
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
view localhost_resolver {
match-clients { any; }; //改正成any
match-destinations { any; }; //改正成any
recursion yes;
include "/etc/named.rfc1912.zones";
};
----------------------------------------------------------------------
三.改正主机配置文件的扩大文件
[root@server etc]# vim named.rfc1912.zones //改正主机配置文件的扩大名在最后一行增添
----------------------------------------------------------------------
zone "linuxidc.com" IN { //IN无关紧要
type master; //范例为主域
file "linuxidc.com"; //域配置文件
};
---------------------------------------------------------------------
四.成立linuxidc.com的域配置文件
[root@server etc]# cd /var/named/chroot/var/named/ //进入/var/named/chroot/var/named/目录
[root@server named]# cp named.local linuxidc.com //拷贝域配置文件
[root@server named]# vim linuxidc.com
--------------------------------------------------------------------
$TTL 86400
@ IN SOA localhost. root.localhost. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS localhost.
www IN A 192.168.1.2 //改正最后一行为...(此行)
--------------------------------------------------------------------
[root@server named]# bind-chroot-admin -s //自动设置组和权限
[root@server named]# service named restart //重启named服务
五.测试考证
[root@localhost ~]# nslookup //在本机考证解析成功
> www.linuxidc.com
Server: 192.168.1.2
Address: 192.168.1.2#53
Name: www.linuxidc.com
Address: 192.168.1.2
C:\Documents and Settings\Administrator>nslookup //在远端windows扯谎那个考证成功
*** Can't find server name for address 219.244.93.2: Non-existent domain
*** Default servers are not available
Default Server: UnKnown
Address: 219.244.93.2 //本来DNS为219.244.93.2
> server 192.168.1.2 //更改解析主机
Default Server: [192.168.1.2]
Address: 192.168.1.2
> www.linuxidc.com
Server: [192.168.1.2]
Address: 192.168.1.2
Name: www.linuxidc.com
Address: 192.168.1.2
以上是“RedHat CentOS搭建DNS服务器正向解析[服务器安全]”的内容,如果你对以上该文章内容感兴趣,你可以看看七道奇为您推荐以下文章:
本文地址: | 与您的QQ/BBS好友分享! |