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.
Software
- 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
/etc/named.conf
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 10.0.1.1 is my internal router DNS server.
Since I want my DNS server resolve my domain “localdomain”, I have add the zone for “localdomain”.The “1.0.10.in-addr.arpa” is for the reserve lookup.
zone "localdomain." IN {
type master;
file "localdomain.zone";
allow-update { none; };
};
zone "1.0.10.in-addr.arpa." IN {
type master;
file "1.0.10.in-addr.arpa";
allow-update { none; };
};
zone files
We need add the zone files. The files are locate at /var/namd/
- /var/named/localdomain.zone
$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
panda IN A 10.0.1.101
- /var/named/1.0.10.in-addr.arpa
$ORIGIN 0.168.192.in-addr.arpa.
$TTL 1H
@ IN SOA maggie.localdomain. root.maggie.localdomain. ( 2
3H
1H
1W
1H )
0.168.192.in-addr.arpa. 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
nameserver 10.0.1.101
Start the DNS service.
service named start

Use dig command to query the domain. We can see the DNS Server is from 10.0.1.01.
dig www.google.com

use nslookip to test reserve resolution.
Thanks
ReplyDeleteThanks for your information. I have checked dns related queries from this site WhoisXY.com
ReplyDelete