Configuration of DNS Server in Linux5

# Configuration of DNS Server
-----------------------------
# Port Number:53
----------------
# Required RPMS:
----------------
bind-9.3.3-7.el5.i386.rpm
bind-chroot-9.3.3-7.el5.i386.rpm
bind-devel-9.3.3-7.el5.i386.rpm
bind-utils-9.3.3-7.el5.i386.rpm
caching-nameserver-9.3.3-7.el5.i386.rpm

# Configuration Files:
----------------------
/var/named/chroot/etc/named.rfc1912.zones
/var/named/chroot/etc/named.caching-nameserver.conf

# Services and Daemons:
-----------------------
named
network
portmap

# Configuration Steps:
----------------------
vi /var/named/chroot/etc/named.rfc.1912.zone
# Comment the First zone as shown, -Do this step if necessary.
10 # zone "." IN {
11 #   type hint;
12 #     file " named.ca";
13 # };
# Goto the E.O.F. and Add your zones as shown,
51 zone "praveshsailor.com" IN {
52 type master;
53 file "forward.zone";
54 allow-update { none; };
55 };

57 zone "150.168.192.in-addr.arpa" IN {
58 type master;
59 file "reverse.zone";
60 allow-update { none; };
61 };
:wq

# Goto another file and make the changes,
vi /var/named/chroot/etc/named.caching-nameserver.conf
14 options {
15 list-on port 53 { 192.168.150.51; };
23 allow-query { 192.168.150.0/24; };
24 allow-transfer { 192.168.150.0/24; };
25 forwarders { 192.168.150.51; };
26 forward only;
27 };
34 view localhost_resolver {
35 match-clients { 192.168.150.0/24; };
36 match-destinations { 192.168.150.51; };
39 };
:wq

# Create the zones mentioned in named.rfc1912.zones
cd /var/named/chroot/var/named/
cp -a localdomain.zone forward.zone
cp -a named.local reverse.zone

# Make the changes in forward.zone as shown,
$ TTL 86400
@ IN SOA server.praveshsailor.com root(
42 ;serial
3H ;refresh
. .
. .
. .
IN NS server.praveshsailor.com
server IN A 192.168.150.51
host1 IN A 192.168.150.52
host3 IN A 192.168.150.53
:wq
named-checkzone praveshsailor.com forward.zone
vi reverse.zone
$ TTL 86400
@ IN SOA server.praveshsailor.com root.server.praveshsailor.com. (
19977022700 ;serial
28800 ;refresh
. .
. .
IN NS server.praveshsailor.com.
51 IN PTR server.praveshsailor.com.
52 IN PTR host1.praveshsailor.com.
53 IN PTR host2.praveshsailor.com.
:wq
named-checkzone praveshsailor.com reverse.zone

# Check the network settings in network configuration files.
vi /etc/hosts
# Comment all the lines in this file and Add the following lines at the last.
192.168.150.51 server.praveshsailor.com server
192.168.150.52 host1.praveshsailor.com host1
192.168.150.53 host2.praveshsailor.com host2
:wq

# Check the resolv.conf file. This file should contain following lines only.
vi /etc/resolv.conf
search praveshsailor.com
nameserver 192.168.150.51
:wq

# At last check the following file. The file should like this
vi /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=server.praveshsailor.com
GATEWAY=192.168.150.51
:wq

# Check out the services and daemons.
chkconfig named on
chkconfig portmap on
chkconfig network on
service named restart
service portmap restart
service network restart

# Reinstall the bind RPMs.(Optional Step)
rpm -ivh --aid --force bind-*
# Restart the machine
init 6

# Client side:
--------------
# Check out the network files and make the changes as per server requirement.
/etc/resolv.conf
/etc/hosts
/etc/sysconfig/network

# Tally the server by giving the following commands.
dig -x 192.168.150.51
dig server.praveshsailor.com
nslookup 192.168.150.51
nslookup server.praveshsailor.com
host 192.168.150.51
host server.praveshsailor.com


Comments

Popular Posts

Install and configure rsyslog Centralized logging server in CentOS

How to fix postfix/smtp Network is unreachable error

Could not join realm: Necessary packages are not installed: sssd-tools sssd libnss-sss libpam-sss adcli