DNS SERVER INSTALLATION AND CONFIGURATION IN CENTOS

DNS = Domain Naming Service (or) Domain Name System DNS will resolve the host name for the particular IP address. Here Im Using Centos Server to Setup the DNS Server using BIND.
SETUP1> install Dns Server
yum install caching-nameserver* -y
Loaded plugins: fastestmirror, presto
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: mirror.nbrc.ac.in
* epel: mirror.pregi.net
* extras: mirror.nbrc.ac.in
* ius: mirrors.ircam.fr
* updates: mirror.nbrc.ac.in
Resolving Dependencies
–> Running transaction check
—> Package bind.x86_64 32:9.8.2-0.62.rc1.el6_9.4 will be installed
–> Processing Dependency: bind-libs = 32:9.8.2-0.62.rc1.el6_9.4 for package: 32:bind-9.8.2-0.62.rc1.el6_9.4.x86_64
–> Processing Dependency: portreserve for package: 32:bind-9.8.2-0.62.rc1.el6_9.4.x86_64
–> Processing Dependency: liblwres.so.80()(64bit) for package: 32:bind-9.8.2-0.62.rc1.el6_9.4.x86_64
–> Processing Dependency: libisccfg.so.82()(64bit) for package: 32:bind-9.8.2-0.62.rc1.el6_9.4.x86_64
–> Processing Dependency: libisccc.so.80()(64bit) for package: 32:bind-9.8.2-0.62.rc1.el6_9.4.x86_64
–> Processing Dependency: libisc.so.83()(64bit) for package: 32:bind-9.8.2-0.62.rc1.el6_9.4.x86_64
–> Processing Dependency: libdns.so.81()(64bit) for package: 32:bind-9.8.2-0.62.rc1.el6_9.4.x86_64
–> Processing Dependency: libbind9.so.80()(64bit) for package: 32:bind-9.8.2-0.62.rc1.el6_9.4.x86_64
–> Running transaction check
—> Package bind-libs.x86_64 32:9.8.2-0.62.rc1.el6_9.4 will be installed
—> Package portreserve.x86_64 0:0.0.4-11.el6 will be installed
–> Finished Dependency Resolution
Dependencies Resolved
Package Arch Version Repository Size
Installing:
bind x86_64 32:9.8.2-0.62.rc1.el6_9.4 updates 4.0 M
Installing for dependencies:
bind-libs x86_64 32:9.8.2-0.62.rc1.el6_9.4 updates 892 k
portreserve x86_64 0.0.4-11.el6 base 23 k
Transaction Summary
Install 3 Package(s)
Total download size: 4.9 M
Installed size: 9.6 M
Downloading Packages:
Setting up and reading Presto delta metadata
Processing delta metadata
Package(s) data still to download: 4.9 M
(1/3): bind-9.8.2-0.62.rc1.el6_9.4.x86_64.rpm | 4.0 MB 00:03
(2/3): bind-libs-9.8.2-0.62.rc1.el6_9.4.x86_64.rpm | 892 kB 00:00
(3/3): portreserve-0.0.4-11.el6.x86_64.rpm | 23 kB 00:00
Total 539 kB/s | 4.9 MB 00:09
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : portreserve-0.0.4-11.el6.x86_64 1/3
Installing : 32:bind-libs-9.8.2-0.62.rc1.el6_9.4.x86_64 2/3
Installing : 32:bind-9.8.2-0.62.rc1.el6_9.4.x86_64 3/3
Verifying : 32:bind-libs-9.8.2-0.62.rc1.el6_9.4.x86_64 1/3
Verifying : 32:bind-9.8.2-0.62.rc1.el6_9.4.x86_64 2/3
Verifying : portreserve-0.0.4-11.el6.x86_64 3/3
Installed:
bind.x86_64 32:9.8.2-0.62.rc1.el6_9.4
Dependency Installed:
bind-libs.x86_64 32:9.8.2-0.62.rc1.el6_9.4 portreserve.x86_64 0:0.0.4-11.el6
Complete!
Setup 2 > service Start
service named restart
Stopping named: [ OK ]
Generating /etc/rndc.key: [ OK ]
Starting named: [ OK ]
setup 3 > check DNS
vi /etc/resolve.conf
nameserver 127.0.0.1
save this file.
Ping google.com
64 bytes from bom07s10-in-f14.1e100.net (216.58.220.174): icmp_seq=1 ttl=54 time=47.0 ms
64 bytes from bom07s10-in-f14.1e100.net (216.58.220.174): icmp_seq=2 ttl=54 time=46.2 ms
64 bytes from bom07s10-in-f14.1e100.net (216.58.220.174): icmp_seq=3 ttl=54 time=46.5 ms
64 bytes from bom07s10-in-f14.1e100.net (216.58.220.174): icmp_seq=4 ttl=54 time=46.7 ms
Note: This Dns server allow to query local server. We need to change some parameter for allow query to all users;
Setup 4>
open dns configuration file and change some perameter
vi /etc/named.conf
options {
listen-on port 53 { 127.0.0.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”;
allow-query { localhost; };
recursion yes;
change>
options {
listen-on port 53 { 10.59.60.192; };
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; };
recursion yes;
change ip address for your server
/etc/resolve.conf
nameserver 10.59.60.192
save this file and restart dns service. Dns server is working now.
ping google.com
PING google.com (172.217.26.238) 56(84) bytes of data.
64 bytes from bom05s09-in-f14.1e100.net (172.217.26.238): icmp_seq=1 ttl=55 time=49.7 ms
64 bytes from bom05s09-in-f14.1e100.net (172.217.26.238): icmp_seq=2 ttl=55 time=49.3 ms
Setup 5>
Manage your zone file :
Forword zone >
Add these line end of file:
vi /etc/named.rfc1912.zones
zone “web.kosecurity.in” IN {
type master;
file “web.kosecurity.zone”;
allow-update { none; };
};
create forword zone file >
/var/named/
cp named.localhost web.kosecurity.zone
zone file look this
$TTL 86400
@ IN SOA web.kosecurity.in. root.web.kosecurity.in. (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS web.kosecurity.in.
web.kosecurity.in. IN A 10.59.60.192
web.kosecurity.in. IN MX 0 web.kosecurity.in.
Save and restart named service.
Check > nslookup and dig command
nslookup web.kosecurity.in
Server: 10.59.60.192
Address: 10.59.60.192#53
Name: web.kosecurity.in
Address: 10.59.60.192
dig web.kosecurity.in MX
; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.62.rc1.el6_9.4 <<>> web.kosecurity.in MX
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 20346 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1 ;; QUESTION SECTION: ;web.kosecurity.in. IN MX ;; ANSWER SECTION: web.kosecurity.in. 86400 IN MX 0 web.kosecurity.in. ;; AUTHORITY SECTION: web.kosecurity.in. 86400 IN NS web.kosecurity.in. ;; ADDITIONAL SECTION: web.kosecurity.in. 86400 IN A 10.59.60.192 ;; Query time: 0 msec ;; SERVER: 10.59.60.192#53(10.59.60.192) ;; WHEN: Mon Aug 21 12:57:03 2017 ;; MSG SIZE rcvd: 81 configure Reverce zone>
add end of this file /etc/named.rfc1912.zones
zone “192.60.59.10.in-addr.arpa” IN {
type master;
file “web.kosecurity.loopback”;
allow-update { none; };
};
After save this file create loopback zone file /var/named/
web.kosecurity.loopback
$TTL 86400
@ IN SOA 192.60.59.10.in-addr.arpa. web.kosecurity.in. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
192.60.59.10.in-addr.arpa. IN NS web.kosecurity.in.
192.60.59.10.in-addr.arpa. IN PTR web.kosecurity.in.
Save and restart dns service
check > nslookup
nslookup 10.59.60.192
Server: 10.59.60.192
Address: 10.59.60.192#53
192.60.59.10.in-addr.arpa name = web.kosecurity.in.

Be the first to comment

Leave a Reply

Your email address will not be published.


*