- 论坛徽章:
- 0
|
Normal
0
7.8 磅
0
2
false
false
false
MicrosoftInternetExplorer4
st1\:*{behavior:url(#ieooui) }
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:普通表格;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
Cenos5.2 +DNS
这里只将具体实现过程,写一下,原理性的东西,自己其google上搜吧~~
前提:
hostname: grid1.hrwang.com
ip:
192.168.254.142
1. 安装如下的包:
[root@grid1 named]# rpm -qa |grep
bind
bind-9.3.4-6.P1.el5
bind-libs-9.3.4-6.P1.el5
ypbind-1.19-8.el5
bind-sdb-9.3.4-6.P1.el5
bind-utils-9.3.4-6.P1.el5
bind-devel-9.3.4-6.P1.el5
bind-chroot-9.3.4-6.P1.el5
bind-libbind-devel-9.3.4-6.P1.el5
2. 删除了/etc/下的
named.caching-nameserver.conf
named.rfc1912.zones
3. 更改/var/named/chroot/etc下的named.caching-nameserver.conf, 将红色部分更改为如下这样。
//
// named.caching-nameserver.conf
//
// Provided by Red Hat caching-nameserver
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.
//
// DO NOT EDIT THIS FILE - use
system-config-bind or an editor
// to create named.conf - edits to this file
will be lost on
// caching-nameserver package upgrade.
//
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";
};
4. 更改/var/named/chroot/etc下的named.rfc1912.zones文件,添加如下红色部分。
// named.rfc1912.zones:
//
// Provided by Red Hat caching-nameserver
package
//
// ISC BIND named zone configuration for
zones recommended by
// RFC 1912 section 4.1 : localhost TLDs and
address zones
//
// See /usr/share/doc/bind*/sample/ for
example named configuration files.
//
zone "." IN {
type hint;
file "named.ca";
};
zone "localdomain" IN {
type master;
file "localdomain.zone";
allow-update { none; };
};
zone "localhost" IN {
type master;
file "localhost.zone";
allow-update { none; };
};
zone "0.0.127.in-addr.arpa" IN {
type master;
file "named.local";
allow-update { none; };
};
zone "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa"
IN {
type master;
file "named.ip6.local";
allow-update { none; };
};
zone "255.in-addr.arpa" IN {
type master;
file "named.broadcast";
allow-update { none; };
};
zone "0.in-addr.arpa" IN {
type master;
file "named.zero";
allow-update { none; };
};
zone "hrwang.com" IN {
type master;
file "hrwang.com.db";
allow-update { none; };
};
zone
"254.168.192.in-addr.arpa" IN {
type master;
file "254.168.192.db";
allow-update { none; };
};
5. 在/var/named/chroot/var/named下创建 hrwang.com.db文件,用于正向解析。内容如下:
$TTL 86400
@ IN SOA grid1.hrwang.com root (
20090506 ;serial
28800 ;refresh
7200 ;retry
604800 ;expiry
86400 ) ;minimum
IN
NS grid1.hrwang.com
grid1 IN A
192.168.254.142
grid2 IN A
192.168.254.143
grid3 IN A
192.168.254.200
6. 在/var/named/chroot/var/named下创建254.168.192.db,内容如下:
$TTL 86400
@ IN SOA grid1.hrwang.com. root.grid1.hrwang.com. (
20090506 ;serial
28800 ;refresh
7200 ;retry
604800 ;expiry
86400 ) ;minimum
IN
NS hrwang.com.
142 IN PTR
grid1.hrwang.com.
143 IN PTR
grid2.hrwang.com.
200 IN
PTR grid3.hrwang.com.
7. 权限设置
-rw-r--r-- 1 root
named 400 May 7 01:41 254.168.192.db
-rw-r--r-- 1 root
named 272 May 7 01:42 hrwang.com.db
8.配置
在/etc/resolve.conf文件中添加如下一行
nameserver 192.168.254.142
9. 启动
/etc/init.d/named
start
10. 检测
[root@grid1 named]# nslookup
192.168.254.142
Server: 192.168.254.142
Address: 192.168.254.142#53
142.254.168.192.in-addr.arpa name = grid1.hrwang.com.
[root@grid1 named]# nslookup
192.168.254.143
Server: 192.168.254.142
Address: 192.168.254.142#53
143.254.168.192.in-addr.arpa name = grid2.hrwang.com.
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/22677/showart_1964865.html |
|