DNS
DNS
DNS
What is DNS?
Types of Zones:
1 .Forward Lookup Zone: This Zone contains information for converting
Hostname to IP Address.
var/named/chroot/var/named/ localdomain.zone
var/named/chroot/var/named/ localhost.zone
2. Reverse Lookup Zone: This zone contains information for converting IP Address
to Hostname.
bind*
caching* -y
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
// DO NOT EDIT THIS FILE - use system-config-bind or an editor
// to create named.conf - edits to this file will be lost on
// caching-nameserver package upgrade.
//
options {
listen-on port 53 { 127.0.0.1;192.168.5.1; };
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";
query-source port 53;
query-source-v6 port 53;
allow-query { localhost; 192.168.5.0/24;};
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
view localhost_resolver {
match-clients
{ localhost; 192.168.5.0/24; };
match-destinations { localhost; };
recursion yes;
include "/etc/named.rfc1912.zones";
};
Click on Save and Exit from gedit command
Step5 : Create Zone / Domain name in /etc/named.rfc1912.zones
[root@mylinuxpc1 /]# gedit /etc/named.rfc1912.zones
// named.rfc1912.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.
//
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 "linuxtechies.com" IN {
type master;
file "linuxtech.for";
allow-update { none; };
};
zone "5.168.192.in-addr.arpa" IN {
type master;
file "linuxtech.rev";
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; };
};
Click on Save and Exit from gedit
named.zero
IN NS
IN A
IN A
mylinuxpc1.linuxtechies.com.
192.168.5.1
192.168.5.1
[root@mylinuxpc1 named]#
Step7 : Create Reverse Lookup Zone file in /var/named/chroot/var/named
[root@mylinuxpc1 named]# vi linuxtech.rev
$TTL 86400
@
IN
SOA
@
1
:wq
IN
IN
mylinuxpc1.linuxtechies.com. root.mylinuxpc1.linuxtechies.com. (
1997022700 ; Serial
28800
; Refresh
14400
; Retry
3600000 ; Expire
86400 ) ; Minimum
NS
mylinuxpc1.linuxtechies.com.
PTR mylinuxpc1.linuxtechies.com.
;; ANSWER SECTION:
www.linuxtechies.com. 86400 IN
;; AUTHORITY SECTION:
linuxtechies.com. 86400 IN
A
NS
192.168.5.1
mylinuxpc1.linuxtechies.com.
;; ADDITIONAL SECTION:
mylinuxpc1.linuxtechies.com. 86400 IN A
;; Query time: 0 msec
;; SERVER: 192.168.5.1#53(192.168.5.1)
;; WHEN: Fri Jul 05 15:15:05 2013
192.168.5.1