文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>Centos5.2+DNS

Centos5.2+DNS

时间:2009-06-15  来源:benxiong

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="ProgId" content="Word.Document"><meta name="Generator" content="Microsoft Word 11"><meta name="Originator" content="Microsoft Word 11"><link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CADMINI%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml"><style> </style>

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.

相关阅读 更多 +
排行榜 更多 +
神龙崛起之战

神龙崛起之战

冒险解谜 下载
合金击车

合金击车

冒险解谜 下载
隐藏旅途2逃脱冒险

隐藏旅途2逃脱冒险

冒险解谜 下载