Configuring DNS with BIND on Oracle Linux 6

Before start, I configured this based on other examples on web and I am configuring to being use for Single Client Access Name (SCAN) on Oracle RAC configuration. This DNS configuration is for a test environment, this is for make SCAN work. if you are using virtual machines I recommend you to install the DNS on separete virtual machine or your host machine.

I am using example.com domain so if you are using different domain or localhost you have to change according to your DNS configuration files.

DNS Installation

[root@dns ~]# yum install bind-libs bind bind-utils -y

DNS Configuration files

Now we have to configure the following files

  • DNS configuration file
    /etc/named.conf
  • domain zone file
    /var/named/example.com.zone
  • reverse dns zone file
    /var/named/1.168.192.in-addr.arpa
  • Resolv file
    /etc/resolv.conf

/etc/named.conf

[root@dns ~]# cat /etc/named.conf

options {
        listen-on port 53 { 127.0.0.1; 192.168.1.175; };
        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     { localhost; 192.168.0.0; };
        recursion yes;

        dnssec-enable yes;
        dnssec-validation yes;

        /* Path to ISC DLV key */
        bindkeys-file "/etc/named.iscdlv.key";

        managed-keys-directory "/var/named/dynamic";
                forwarders { 8.8.8.8; 8.8.4.4; };
};

logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};

zone "example.com" IN {
        type master;
        file "example.com.zone";
        allow-update { none; };
};

zone "1.168.192.in-addr.arpa." IN {
        type master;
        file "1.168.192.in-addr.arpa";
        allow-update { none; };
};

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";

/var/named/example.com.zone

description of the IPs to be configure in this file

Public
192.168.1.101 host01.example.com host01
192.168.1.102 host02.example.com host02
192.168.1.103 host03.example.com host03
Private
192.168.2.101 host01-priv1.example.com host01-priv1
192.168.2.102 host02-priv1.example.com host02-priv1
192.168.2.103 host03-priv1.example.com host03-priv1
192.168.2.121 host01-priv2.example.com host01-priv2
192.168.2.122 host02-priv2.example.com host02-priv2
192.168.2.123 host03-priv2.example.com host03-priv2
Virtual
192.168.1.111 host01-vip.example.com host01-vip
192.168.1.112 host02-vip.example.com host02-vip
192.168.1.113 host03-vip.example.com host03-vip
SCAN
192.168.1.121 cluster01-scan.example.com cluster01-scan
192.168.1.122 cluster01-scan.example.com cluster01-scan
192.168.1.123 cluster01-scan.example.com cluster01-scan
[root@dns ~]# cat /var/named/example.com.zone
$TTL    86400
@               IN SOA  dns.example.com. root.example.com.(
                                        42              ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum
                IN NS           dns.example.com.
dns                     IN A    192.168.1.175
host01          IN A    192.168.1.101
host02          IN A    192.168.1.102
host03          IN A    192.168.1.103
host01-priv1    IN A    192.168.2.101
host02-priv1    IN A    192.168.2.102
host03-priv1    IN A    192.168.2.103
host01-priv2    IN A    192.168.2.121
host02-priv2    IN A    192.168.2.122
host03-priv2    IN A    192.168.2.123
host01-vip      IN A    192.168.1.111
host02-vip      IN A    192.168.1.112
host03-vip      IN A    192.168.1.113
cluster01-scan  IN A    192.168.1.121
cluster01-scan  IN A    192.168.1.122
cluster01-scan  IN A    192.168.1.123

/var/named/1.168.192.in-addr.arpa

[root@dns ~]# cat /var/named/1.168.192.in-addr.arpa
$TTL 1H
@       IN      SOA     dns.example.com.     root.dns.example.com. (      2
                                                3H
                                                1H
                                                1W
                                                1H )
1.168.192.in-addr.arpa.         IN NS      dns.example.com.

101     IN PTR  host01.example.com.
102     IN PTR  host02.example.com.
103     IN PTR  host03.example.com.
111     IN PTR  host01-vip.example.com.
112     IN PTR  host02-vip.example.com.
113     IN PTR  host03-vip.example.com.
121     IN PTR  cluster01-scan.example.com.
122     IN PTR  cluster01-scan.example.com.
123     IN PTR  cluster01-scan.example.com.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s