1. Application: Name Resulation
Name => IP (www.dbl-group.com => 203.112.194.17)
IP => Name (203.112.194.17 => www.dbl-group.com)
Daemon: named
Packages: bind
Port: 53
Protocol: TCP and UdP
Configuration file:
=> /etc/sysconfig/network-scripts/ifcfg-en*
=> /etc/hosts
=> /etc/hostname
=> /etc/named.conf
=> /etc/named.rfc1912.zones
=> /var/named/named.localhost (Forward Zone)
=> /var/named/named.looback (Reverse Zone)
Step 01: Set Static IP Address and DNS:
--------------------------------------
[root@desktopX ~]# cd /etc/sysconfig/network-scripts/
[root@desktopX network-scripts]# ls
[root@desktopX network-scripts]# vim ifcfg-en* ; your Interface name
NAME=********
HWADDR=*******
TYPE=Ethernet
BOOTPROTO=none
IPADDR=192.168.11.X
NETMASK=255.255.255.0
GATEWAY=192.168.11.1
ONBOOT=yes
DNS1=192.168.11.X
[root@desktopX network-scripts]# systemctl stop NetworkManager.service
[root@desktopX network-scripts]# systemctl disable NetworkManager.service
[root@desktopX network-scripts]# systemctl restart network.service
[root@desktopX network-scripts]# cat /etc/resolv.conf
Step 02: Local resolver entry:
------------------------------
[root@desktopX ~]# vim /etc/hosts
192.168.11.X ns1.dbl-group.com ns1 ; add below of 2 lines
* save and exit
[root@desktopX ~]# ping ns1.dbl-group.com
2. Step 03: Set Static Host Name and Reboot:
----------------------------------------
[root@desktopX ~]# vim /etc/hostname
ns1.dbl-group.com
[root@desktopX ~]# reboot
Step 04: Install Required RPM:
------------------------------
[root@ns1 ~]# yum install bind* -y
Step 05: Allow DNS Server IP and Network:
----------------------------------------
[root@ns1 ~]# cp /etc/named.conf /etc/named.conf.backup
[root@ns1 ~]# vim /etc/named.conf
11 listen-on port 53 { 127.0.0.1; 192.168.11.X; };
12 # listen-on-v6 port 53 { ::1; };
17 allow-query { localhost; 192.168.11.0/24; };
Step 06: Set Forward and Reverse Zones:
---------------------------------------
[root@ns1 ~]# cp /etc/named.rfc1912.zones /etc/named.rfc1912.zones.backup
[root@ns1 ~]# vim /etc/named.rfc1912.zones
19 zone "dbl-group.com" IN {
20 type master;
21 file "dbl-group.com.for";
22 allow-update { none; };
23 };
31 zone "11.168.192.in-addr.arpa" IN {
32 type master;
33 file "dbl-group.com.rev";
34 allow-update { none; };
35 };
Step 07: Create Forward and Reverse Zone Files:
-----------------------------------------------
[root@ns1 Desktop]# cd /var/named/
[root@ns1 named]# ls
[root@ns1 named]# cp named.localhost dbl-group.com.for
[root@ns1 named]# cp named.loopback dbl-group.com.rev
[root@ns1 named]# ls -l
Step 08: Set Ownership to Forward and Reverse Zone Files:
---------------------------------------------------------
[root@ns1 named]# ll example.com.*
-rw-r-----. 1 root root 152 Mar 21 13:59 dbl-group.com.for
-rw-r-----. 1 root root 168 Mar 21 13:59 dbl-group.com.rev
[root@ns1 named]# chgrp named dbl-group.com.*
3. [root@ns1 named]# ll dbl-group.com.*
-rw-r-----. 1 root named 152 Mar 21 13:59 dbl-group.com.for
-rw-r-----. 1 root named 168 Mar 21 13:59 dbl-group.com.rev
Step 09: Edit Forward Zone File:
--------------------------------
[root@ns1 named]# vim dbl-group.com.for
$TTL 1D
@ IN SOA ns1.dbl-group.com. root.example.com. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
IN NS ns1.dbl-group.com.
IN A 192.168.11.X
ns1 IN A 192.168.11.X
Note:
-----
SOA - Start of Authority
IN - Internet
NS - Name Server (DNS Server)
A - Host Record (IP Address)
root - email admin
PTR - Pointer (Reverse)
Step 10: Edit Reverse Zone File:
--------------------------------
[root@ns1 named]# vim dbl-group.com.rev
$TTL 1D
@ IN SOA ns1.dbl-group.com. root.dbl-group.com. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
IN NS ns1.dbl-group.com.
X IN PTR ns1.dbl-group.com.
Step 11: Service restart and configured active at boot time:
------------------------------------------------------------
[root@ns1 named]# systemctl restart named.service
[root@ns1 named]# systemctl enable named.service
Step 12: Checking DNS