Step1: Install Bind9 and Bind9 Utils on the Centos Server
[root@dns ~]# yum install bind bind-utils
Step2: Update the Resolv.conf file with the DNS Server and Domain Information
[root@dns01 ~]# mv /etc/resolv.conf /etc/resolv.conf.orig
[root@dns01 ~]# vim /etc/resolv.conf
domain abc.com
search abc.com
nameserver 192.168.10.101
nameserver 192.168.10.102
Step3: Rename the named.conf file as below on the Centos Server
[root@dns ~]# mv /etc/named.conf /etc/named.conf.orig
Step4: Edit the named.conf file using vim tool on the Centos Server
[root@dns ~]# vim /etc/named.conf
//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
// See the BIND Administrator's Reference Manual (ARM) for details about the
// configuration located in /usr/share/doc/bind-{version}/Bv9ARM.html
acl "trusted-recursion" {
localhost;
localnets;
192.168.10.0/24;
};
options {
listen-on port 53 { any; };
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";
allow-query { any; };
allow-recursion { trusted-recursion; };
allow-query-cache { trusted-recursion; };
recursion yes;
dnssec-enable yes;
dnssec-validation no;
/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";
managed-keys-directory "/var/named/dynamic";
pid-file "/run/named/named.pid";
session-keyfile "/run/named/session.key";
# Setup Google's dns as forwarder DNS Servers
forwarders {
8.8.8.8;
8.8.4.4;
};
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
### ZONE . Contains the root hint server Information ###
zone "." IN {
type hint;
file "named.ca";
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
zone "abc.com" {
type master;
file "var/named/abc.com.db"; # zone file path
allow-transfer { 192.168.10.102; };
notify yes;
};
zone "10.168.192.in-addr.arpa" in {
type master;
file "dynamic/10.168.192.in-addr.arpa.zone";
allow-transfer { 192.168.10.102; };
notify yes;
};
Step5: Create the Forward Zone file for abc.com
[root@dns01 ~]# vim /var/named/dynamic/db.abc.com
; Remember to update the serial by 1 each time you edit this file!
$TTL 300 ; 5 minutes
@ IN SOA dns01.abc.com. admin.abc.com. (
1 ; Serial
3600 ; Refresh
300 ; Retry
1814400 ; Expire
300 ) ; Negative Cache TTL
; name servers - NS records
IN NS dns01.abc.com.
IN NS dns02.abc.com.
; name servers - A records
dns01.abc.com. IN A 192.168.10.101
dns02.abc.com. IN A 192.168.10.102
; All other A records
abc.com. IN A 192.168.10.150
www.abc.com. IN A 192.168.10.151
mail.abc.com. IN A 192.168.10.152
fileshare.abc.com. IN A 192.168.10.153
intranet.abc.com. IN A 192.168.10.154
Step6: Create the Reverse Zone file for the abc.com
[root@dns01 ~]# vim /var/named/dynamic/10.168.192.in-addr.arpa.zone
vim /var/named/dynamic/10.168.192.in-addr.arpa.zone
$ORIGIN 10.168.192.in-addr.arpa.
$TTL 86400 ; 1 day
@ IN SOA dns01.abc.com. admin.abc.com. (
1 ; Serial
7200 ; refresh (2 hous)
7200 ; retry (2 hours)
2419200 ; expire (5 weeks 6 days 16 hours)
86400 ) ; minimum (1 day)
10.168.192.in-addr.arpa. IN NS dns01.abc.com.
10.168.192.in-addr.arpa. IN NS dns02.abc.com.
101 IN PTR dns01.abc.com.
102 IN PTR dns02.abc.com.
151 IN PTR www.abc.com.
152 IN PTR mail.abc.com.
153 IN PTR fileshare.abc.com.
154 IN PTR intranet.abc.com.
Step7: Check the Named.conf file is having the correct syntax
[root@dns01 ~]# named-checkconf /etc/named.conf
Step8: Change the group owner for the forward zone file
[root@dns01 ~]# chgrp named abc.com.db
Step8: Restart and Enable the Named Service
[root@dns01 ~]# systemctl enable named
[root@dns01 ~]# systemctl restart named
0 comments:
Post a Comment