Monday, January 14, 2013

2 DNS Server

This is my note to build the DNS server on Linux. The note is not intend to cover everything about how to build the DNS environment but only good enough for me to continue my Oracle testing environment .

The reason that Oracle require the DNS server is that Oracle RAC requires to set up the SCAN ip address.



  • Oracle Enterprise Linux 6.3
  • Virtual Box 4.2.6
  • Bind –> The DNS software


Install the Oracle Linux on Virtual Box

Refer here.


Install Bind

We can use rpm –qa to list all the rpm installed on the host. If below three packages are not installed, we can use yum to install it.


  • bind
  • bind-lib
  • bind-utils


yum install bind bind-libs bind-utils



This is main DNS configuration file.

  • Listen-on : This is to defined which IP address the BIND would listen to. Add my current host ip address to the list.
  • forward only: This is to enable the DNS server forward the name look up to the lists DNS servers ( configure in the forwarders )
  • Forwarders: My DNS is primary for internal name resolution. If the name can not be found in the internal zone, it would forward the request in the list DNS server. The is my internal router DNS server.



Since I want my DNS server resolve my domain “localdomain”, I have add the zone for “localdomain”.The “” is for the reserve lookup.

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


zone files

We need add the zone files. The files are locate at /var/namd/

  • /var/named/


$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  
panda       IN A      
  • /var/named/
@       IN      SOA     maggie.localdomain.     root.maggie.localdomain. (      2
                                                1H )         IN NS      maggie.localdomain.
101     IN PTR  rac1.localdomain.


Start the DNS server and test it

On the network card, set it for using the local DNS server.


We need to bounce the network service or network interface card to make it effective. Alternativly, we can set it at /etc/resolve.conf

search localdomain


Start the DNS service.

service named start

Use dig command to query the domain. We can see the DNS Server is from


use nslookip to test reserve resolution.




SQL Panda Copyright © 2011 - |- Template created by O Pregador - |- Powered by Blogger Templates