Master DNS Server Profile:-
A = Address record
PTR = Pointer record
NS = Name service / server
MX = Mail Exchanger
SOA = State of Authority
CNAME = Canonical name / Alias Name
„h Packages Required : bind*
„h Version : 9
„h Daemon : named
„h Config File : /var/named/chroot/etc/named.conf /var/named/chroot/etc/named.rfc1912.zone
„h Default zone files location : /var/named/chroot/var/named/
„h Port Number : 53
[root@classroom ~]# yum install bind*
First start named-chroot before named.service because it will generate config files
[root@classroom ~]# systemctl enable named-chroot.service
[root@classroom ~]# systemctl start named-chroot.service
[root@classroom ~]# systemctl enable named.service
[root@classroom ~]# systemctl start named.service
[root@classroom ~]# vim /var/named/chroot/etc/named.conf
options {
listen-on port 53 { 127.0.0.1; 192.168.72.10; };
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 { localhost; 192.168.72.10; };
(Default line number is 10-17) As shown above enter your DNS server IP address (which is your server address) and network address which network you want to provide DNS service.
Now edit zones configuration file
[root@Techtutorial ~]# vim /var/named/chroot/etc/named.rfc1912.zones
zone "example.com" IN {
type master;
file "example.for.zone";
allow-update { none; };
};
zone "72.168.192.in-addr.arpa" IN {
type master;
file "example.rev.zone";
allow-update { none; };
};
Creating Zone files
named.local ¡V> example.for.zone
named.loopback ¡V> example.rev.zone
[root@classroom named]# cd /var/named/chroot/var/named
[root@classroom named]# cp named.localhost example.for.zone
[root@classroom named]# cp named.loopback example.rev.zone
[root@classroom named]# vim example.for.zone
$TTL 1D
@ IN SOA classroom.example.com. root.classroom.example.com. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
NS classroom.example.com.
example.com. A 192.168.72.10
classroom A 192.168.72.10
As shown in above configuration classroom.example.com. ¡V DNS Server Name and domain name add NS record as DNS Server name and domain name (do not forgot to add (dot) yet end)
First A record will be your domain name and DNS server IP address
[root@classroom named]# vim example.rev.zone
$TTL 1D
@ IN SOA classroom.example.com. root.classroom.example.com. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
NS classroom.example.com.
10 PTR classroom.example.com.
Note: Even do not miss single (dot) which will not start your named service
Master DNS configuration Linux Step by Step Guide
i have shown single host record as a example if you want to add more records add them
Now change the ownership of created files to named group
[root@classroom named]# chown root:named example.for.zone
[root@classroom named]# chown root:named example.rev.zone
Add firewall rule to communicate DNS port out
[root@classroom~]# firewall-cmd --permanent --add-service=dns
success
[root@classroom~]# firewall-cmd --reload
success
Now restart your named service.
[root@classroom named]# systemctl restart named.service[root@classroom]# systemctl status named.service
A = Address record
PTR = Pointer record
NS = Name service / server
MX = Mail Exchanger
SOA = State of Authority
CNAME = Canonical name / Alias Name
„h Packages Required : bind*
„h Version : 9
„h Daemon : named
„h Config File : /var/named/chroot/etc/named.conf /var/named/chroot/etc/named.rfc1912.zone
„h Default zone files location : /var/named/chroot/var/named/
„h Port Number : 53
[root@classroom ~]# yum install bind*
First start named-chroot before named.service because it will generate config files
[root@classroom ~]# systemctl enable named-chroot.service
[root@classroom ~]# systemctl start named-chroot.service
[root@classroom ~]# systemctl enable named.service
[root@classroom ~]# systemctl start named.service
[root@classroom ~]# vim /var/named/chroot/etc/named.conf
options {
listen-on port 53 { 127.0.0.1; 192.168.72.10; };
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 { localhost; 192.168.72.10; };
(Default line number is 10-17) As shown above enter your DNS server IP address (which is your server address) and network address which network you want to provide DNS service.
Now edit zones configuration file
[root@Techtutorial ~]# vim /var/named/chroot/etc/named.rfc1912.zones
zone "example.com" IN {
type master;
file "example.for.zone";
allow-update { none; };
};
zone "72.168.192.in-addr.arpa" IN {
type master;
file "example.rev.zone";
allow-update { none; };
};
Creating Zone files
Forward lookup zone ¡V forward lookup zone will convert host name name to IP address
Reverse lookup zone ¡V reverse lookup zone will convert IP address to host name
change directory path to /var/named/chroot/var/named/
copy the files as per the file names which we have mentioned in above zones configuration file.
In this examplenamed.local ¡V> example.for.zone
named.loopback ¡V> example.rev.zone
[root@classroom named]# cd /var/named/chroot/var/named
[root@classroom named]# cp named.localhost example.for.zone
[root@classroom named]# cp named.loopback example.rev.zone
[root@classroom named]# vim example.for.zone
$TTL 1D
@ IN SOA classroom.example.com. root.classroom.example.com. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
NS classroom.example.com.
example.com. A 192.168.72.10
classroom A 192.168.72.10
As shown in above configuration classroom.example.com. ¡V DNS Server Name and domain name add NS record as DNS Server name and domain name (do not forgot to add (dot) yet end)
First A record will be your domain name and DNS server IP address
[root@classroom named]# vim example.rev.zone
$TTL 1D
@ IN SOA classroom.example.com. root.classroom.example.com. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
NS classroom.example.com.
10 PTR classroom.example.com.
Note: Even do not miss single (dot) which will not start your named service
Master DNS configuration Linux Step by Step Guide
i have shown single host record as a example if you want to add more records add them
Now change the ownership of created files to named group
[root@classroom named]# chown root:named example.for.zone
[root@classroom named]# chown root:named example.rev.zone
Add firewall rule to communicate DNS port out
[root@classroom~]# firewall-cmd --permanent --add-service=dns
success
[root@classroom~]# firewall-cmd --reload
success
Now restart your named service.
[root@classroom named]# systemctl restart named.service[root@classroom]# systemctl status named.service
No comments:
Post a Comment