Home > Miscellaneous > Configuring DNS server

Configuring DNS server


1. Installed required libraries for setting up DNS server. Check the link public-yum.oracle.com for configuring yum server

# yum install bind-libs bind bind-utils

If DNS gui editor is required install the following package

# yum install system-config-bind

 

2. Do the following to setup DNS properly

a) edit /etc/named.conf file

Domain name for my server is localdomain and ip address in 10.0.0.31. Also make sure port 53 is open. Add a forwarder to make sure names are resolved on the external network also. Here i’m using google DNS servers (8.8.8.8,8.8.4.4)

options {
 // Set IP address correctly.
 listen-on port 53 { 127.0.0.1; 10.0.0.31; };
//
 // Leave the rest of the config as it is.
 //
// My Additions
 // Forwarder: Anything this DNS can't resolve gets forwarded to my ISPs DNS.
 forwarders { 8.8.8.8;8.8.4.4; };
 // End My Additions
 directory "/var/named/";
};

I’m using localdomain as my domain name, so i need to add a zone for it

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

file parameter above refers to a file in /var/named directory that contains configuration of this zone

The above configuration is enabled only forward lookup, If we want reverse lookup also add below lines also to /etc/named.conf file

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

 

b) Create the zone file and reverse zone file in /var/named directory.

If you are using the “chroot” version of BIND, the location of the following files will be /var/named/chroot/var/named”

$ cd /var/named

Create localdomain.zone file and add the below entries

$TTL         86400
@                  IN   SOA localhost root.localhost (
                                   42        ; serial (d. adams)
                                   3H        ; refresh
                                   15M       ; retry
                                   1W        ; expiry
                                   1D )      ; minimum
                   IN NS  localhost
localhost          IN A   127.0.0.1
rac1               IN A   10.0.0.31
rac2               IN A   10.0.0.32
rac1-priv          IN A   10.0.0.33
rac2-priv          IN A   10.0.0.34
rac1-vip           IN A   10.0.0.35
rac2-vip           IN A   10.0.0.36
rac-scan           IN A   10.0.0.37
rac-scan           IN A   10.0.0.38
rac-scan           IN A   10.0.0.39

Now create 0.0.10.in-addr.arpa file and add the below entries

$ORIGIN 0.0.10.in-addr.arpa.
$TTL 1H
@                  IN SOA rac1.localdomain. root.rac1.localdomain. ( 2
                                              3H
                                              1H
                                              1W
                                              1H )
0.0.10.in-addr.arpa. IN  NS         rac1.localdomain.
31                   IN PTR         rac1.localdomain.
32                   IN PTR         rac2.localdomain.
33                   IN PTR         rac1-priv.localdomain.
34                   IN PTR         rac2-priv.localdomain.
35                   IN PTR         rac1-vip.localdomain.
36                   IN PTR         rac2-vip.localdomain.
37                   IN PTR         rac-scan.localdomain.
38                   IN PTR         rac-scan.localdomain.
39                   IN PTR         rac-scan.localdomain.

Make sure zones files are owned by root and group is named

lrwxrwxrwx 1 root named 44 Dec 11 11:34 localdomain.zone -> 
                                 /var/named/chroot/var/named/localdomain.zone
lrwxrwxrwx 1 root named 47 Dec 11 11:34 0.0.10.in-addr.arpa -> 
                                 /var/named/chroot/var/named/0.0.10.in-addr.arpa

 

3. Start the DNS service’

# service named start
Starting named:                                            [  OK  ]

Issue the following command to make sure the “named” service starts automatically after reboots.

# chkconfig named on

 

4. Add below entries to /etc/resolv.conf  –>  tells a Linux machine which DNS server to use when attempting to resolve machine names.

search localdomain
nameserver 10.0.0.31

 

5. Testing the DNS setup

[root@rac1 named]# nslookup rac-scan.localdomain
 Server: 10.0.0.31
 Address: 10.0.0.31#53
Name: rac-scan.localdomain
 Address: 10.0.0.39
 Name: rac-scan.localdomain
 Address: 10.0.0.37
 Name: rac-scan.localdomain
 Address: 10.0.0.38
[root@rac1 named]# nslookup 10.0.0.39
 Server: 10.0.0.31
 Address: 10.0.0.31#53
39.0.0.10.in-addr.arpa name = rac-scan.localdomain.
[root@rac1 named]# nslookup 10.0.0.38
 Server: 10.0.0.31
 Address: 10.0.0.31#53
38.0.0.10.in-addr.arpa name = rac-scan.localdomain.
[root@rac1 named]# nslookup 10.0.0.37
 Server: 10.0.0.31
 Address: 10.0.0.31#53
37.0.0.10.in-addr.arpa name = rac-scan.localdomain.
Advertisements
Categories: Miscellaneous Tags: ,
  1. No comments yet.
  1. No trackbacks yet.

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 )

Google+ photo

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

Connecting to %s

Oracle database internals by Riyaj

Discussions about Oracle performance tuning, RAC, Oracle internal & E-business suite.

StartupForce

Where all the Action Is !!!!

Pavan DBA's Blog

The DBA Knowledge Store

ORACLE-BASE - Latest Articles

Where all the Action Is !!!!

%d bloggers like this: