Domain Name System (DNS) Server

Posted byShailesh Posted onAugust 27, 2011 Comments0

DNS – Configuration

Port No- 53
Bind is responsible for DNS services.

If we want to install Bind from Internet than we need to use below command.
#yum install bind bind-chroot caching-nameserver bind-utils

Or
From cd/dvd
cd /media/CentOS_5.4_Final/CentOS/ ..(if the OS is CentOS..otherwise search in RPM in that OS CD)

#rpm -ivh bind*
#rpm -ivh caching-nameserver*

#cp /etc/named.rfc1912.zones /etc/named.conf
cp /etc/named.caching-nameserver.conf /etc/named.conf

vim /etc/named.conf
// named.rfc1914.zones:
//
// Provided by Red Hat caching-nameserver package
//
// ISC BIND named zone configuration for zones recommended by
// RFC 1912 section 4.1 : localhost TLDs and address zones
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
options {
listen-on port 53 { 192.168.0.225; };
listen-on-v6 port 53 { ::1; };
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”;

// Those options should be used carefully because they disable port
// randomization
// query-source port 53;
// query-source-v6 port 53;

allow-query { any; };
allow-query-cache { 192.168.0.0/24; };
};
zone “.” IN {
type hint;
file “named.ca”;
};

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

zone “localhost” IN {
type master;
file “localhost.zone”;
allow-update { none; };
};

zone “0.0.127.in-addr.arpa” IN {
type master;
file “named.local”;
allow-update { none; };
};

zone “0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa” IN {
type master;
file “named.ip6.local”;
allow-update { none; };
};

zone “255.in-addr.arpa” IN {
type master;
file “named.broadcast”;
allow-update { none; };
};

zone “0.in-addr.arpa” IN {
type master;
file “named.zero”;
allow-update { none; };
};

zone “0.in-addr.arpa” IN {
type master;
file “named.zero”;
allow-update { none; };
};
zone “krishna.local” IN {
type master;
file “krishna.zone”;
};
zone “0.168.192.in-addr.arpa” IN {
type master;
file “192.168.0.zone”;
};
save & exit
cd /var/named/
vim krishna.zone
$TTL    86400
@               IN SOA  krishna.local. root.krishna.local. (
42              ; serial (d. adams)
3H              ; refresh
15M             ; retry
1W              ; expiry
1D )            ; minimum
IN NS           krishna.local
krishna.local.  IN A            192.168.0.225
krishna.local.  IN MX   0       192.168.0.225
krishna.local.  IN MX   10      krishna.local.

save & exit

cd /etc/named
cp named.local 192.168.0.zone

vim 192.168.0.zone

$TTL    86400
@       IN      SOA     0.168.192.in-addr.arpa. root.krishna.local.  (
1997022700 ; Serial
28800      ; Refresh
14400      ; Retry
3600000    ; Expire
86400 )    ; Minimum
0.168.192.in-addr.arpa.        IN      NS      krishna.local.
225.0.168.192.in-addr.arpa.       IN      PTR     krishna.local.

save & exit

vi /etc/resolv.conf
nameserver 192.168.0.225

save & exit

bind-chroot-admin -e

service named restart

chkconfig named on

or checking mx entry type command like below……..

nslookup

> set q=mx
> lab.local
dig lab.local
dig -x 192.168.0.4

 

 

 

 

Happy To Help You ….
All Linux Solution & Training.
Genowin Technologies(www.genowin.com)

Category

Leave a Comment