ITPub博客

首页 > Linux操作系统 > Linux操作系统 > redhat6.5关于rac配置DNS的问题

redhat6.5关于rac配置DNS的问题

原创 Linux操作系统 作者:zhangsharp20 时间:2016-09-11 03:25:10 0 删除 编辑
Three packages must be installed on Linux for DNS Server:

  • bind (includes DNS server, named)
  • bind-utils (utilities for querying DNS servers about host information)
  • bind-libs (libraries used by the bind server and utils package)


You can obtain an account from the Yum Server which will install the package for you automatically.  

OR 

You can manually download these packages:   

  • bind.XXX.rpm (for example bind-9.2.4-22.el3.i386.rpm)
  • bind-utils.XXX.rpm
  • bind-libs.XX.rpm

On  dns system edit the "/etc/named.conf" file

[root@ora4 named]# cat /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 { 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";
        allow-query     { any; };     #必须改成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";


zone "ora.com" IN {
type master;
file "ora.com.zone";           #aaaa.zone是/var/named下的反向解析文件
allow-update { none; };
};


#zone "162.168.192.in-addr.arpa." IN {
#type master;
#file "162.168.192.in-addr.arpa";
#allow-update { none; };
#};
[root@ora4 named]# 

配置反向解析文件

[root@ora4 named]# cat /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
// and http://www.ietf.org/internet-drafts/draft-ietf-dnsop-default-local-zones-02.txt
// (c)2007 R W Franks
// 
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//


zone "localhost.localdomain" IN {
        type master;
        file "named.localhost";
        allow-update { none; };
};


zone "localhost" IN {
        type master;
        file "named.localhost";
        allow-update { none; };
};


zone "1.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.loopback";
        allow-update { none; };
};


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 "162.168.192.in-addr.arpa" IN {
        type master;
        file "aaaa.zone";             #aaaa.zone是/var/named下的反向解析文件
        allow-update { none; };
};


[root@ora4 named]# cp -p named.localhost aaaa.zone ora.com.zone



编辑正反向解析文件


正向解析:
[root@ora4 named]# cat ora.com.zone 
$TTL 1D
@       IN SOA  @ rname.invalid. (
                                        0       ; serial
                                        1D      ; refresh
                                        1H      ; retry
                                        1W      ; expire
                                        3H )    ; minimum
        NS      @
        A       127.0.0.1
        AAAA    ::1
scan-ip IN A 192.168.162.7
scan-ip IN A 192.168.162.8
scan-ip IN A 192.168.162.9

反向解析:

[root@ora4 named]# cat aaaa.zone 
$TTL 1D
@       IN SOA  @ rname.invalid. (
                                        0       ; serial
                                        1D      ; refresh
                                        1H      ; retry
                                        1W      ; expire
                                        3H )    ; minimum
        NS      @
        A       127.0.0.1
        AAAA    ::1


162.168.192.in-addr.arpa. IN NS scan-ip.ora.com.
7 IN PTR scan-ip.ora.com.
8 IN PTR scan-ip.ora.com.
9 IN PTR scan-ip.ora.com.


新增的两个文件必须能够被named用户读写
启动DNS服务

[root@ora4 named]# service named restart
Stopping named:                                            [  OK  ]
Starting named:                                            [  OK  ]



测试:

正向测试
[root@ora4 named]# nslookup scan-ip.ora.com
Server:         127.0.0.1
Address:        127.0.0.1#53


Name:   scan-ip.ora.com
Address: 192.168.162.7
Name:   scan-ip.ora.com
Address: 192.168.162.8
Name:   scan-ip.ora.com
Address: 192.168.162.9

反向测试:
[root@ora4 named]# nslookup 192.168.162.9
Server:         127.0.0.1
Address:        127.0.0.1#53


9.162.168.192.in-addr.arpa      name = scan-ip.ora.com.


[root@ora4 named]# nslookup 192.168.162.8
Server:         127.0.0.1
Address:        127.0.0.1#53


8.162.168.192.in-addr.arpa      name = scan-ip.ora.com.


[root@ora4 named]# nslookup 192.168.162.7
Server:         127.0.0.1
Address:        127.0.0.1#53


7.162.168.192.in-addr.arpa      name = scan-ip.ora.com.


RAC节点测试:

一节点:
[root@ora1 ~]# nslookup scan-ip.ora.com
Server:         192.168.162.126
Address:        192.168.162.126#53


Name:   scan-ip.ora.com
Address: 192.168.162.7
Name:   scan-ip.ora.com
Address: 192.168.162.8
Name:   scan-ip.ora.com
Address: 192.168.162.9


[root@ora1 ~]# nslookup 192.168.162.8
Server:         192.168.162.126
Address:        192.168.162.126#53


8.162.168.192.in-addr.arpa      name = scan-ip.ora.com.


[root@ora1 ~]# nslookup 192.168.162.7
Server:         192.168.162.126
Address:        192.168.162.126#53


7.162.168.192.in-addr.arpa      name = scan-ip.ora.com.


[root@ora1 ~]# nslookup 192.168.162.9
Server:         192.168.162.126
Address:        192.168.162.126#53


9.162.168.192.in-addr.arpa      name = scan-ip.ora.com.

二节点:

[root@ora2 Packages]# nslookup scan-ip.ora.com
Server:         192.168.162.126
Address:        192.168.162.126#53


Name:   scan-ip.ora.com
Address: 192.168.162.8
Name:   scan-ip.ora.com
Address: 192.168.162.9
Name:   scan-ip.ora.com
Address: 192.168.162.7


[root@ora2 Packages]# nslookup 192.168.162.7
Server:         192.168.162.126
Address:        192.168.162.126#53


7.162.168.192.in-addr.arpa      name = scan-ip.ora.com.


[root@ora2 Packages]# nslookup 192.168.162.8
Server:         192.168.162.126
Address:        192.168.162.126#53


8.162.168.192.in-addr.arpa      name = scan-ip.ora.com.


[root@ora2 Packages]# nslookup 192.168.162.9
Server:         192.168.162.126
Address:        192.168.162.126#53


9.162.168.192.in-addr.arpa      name = scan-ip.ora.com.



三节点:


[root@ora3 ~]# nslookup scan-ip.ora.com
Server:         192.168.162.126
Address:        192.168.162.126#53


Name:   scan-ip.ora.com
Address: 192.168.162.9
Name:   scan-ip.ora.com
Address: 192.168.162.7
Name:   scan-ip.ora.com
Address: 192.168.162.8


[root@ora3 ~]# nslookup 192.168.162.7
Server:         192.168.162.126
Address:        192.168.162.126#53


7.162.168.192.in-addr.arpa      name = scan-ip.ora.com.


[root@ora3 ~]# nslookup 192.168.162.8
Server:         192.168.162.126
Address:        192.168.162.126#53


8.162.168.192.in-addr.arpa      name = scan-ip.ora.com.


[root@ora3 ~]# nslookup 192.168.162.9
Server:         192.168.162.126
Address:        192.168.162.126#53


9.162.168.192.in-addr.arpa      name = scan-ip.ora.com.

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29802484/viewspace-2124791/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2014-08-12

  • 博文量
    382
  • 访问量
    801412