linux DNS domain name resolution | reverse analysis experiment | super simple and super detailed

Construction of DNS domain name resolution server direction resolution process

➤Install the bind package

yum -y install bind

➤First check the path of the configuration file that needs to be modified

rpm -qc bind
/etc/named.conf #Main configuration file
/etc/named.rfc1912.zones #Zone configuration file
/var/named/named.localhost #Zone data configuration file
Insert picture description here

➤Modify the main configuration file: vim /etc/named.conf

Insert picture description here
Consistent with forward analysis, unchanged

➤Modify the zone configuration file and add the forward zone configuration: vim /etc/ named. rfc1912. zone

Insert picture description here
zone “78.168.192.in-addr.arpa” IN {
type master;
file “tk520.com.zone.local”;
allow-update { none; };
};

➤Configure the forward zone data file: vim /var/named/tk520.com.zone.local

cd /var/named/
cp -p named.localhost tk520.com.zone.local #Keep the permissions of the source file and copy the attributes of the owner

Insert picture description here
vim /var/named/tk520.com.zone.local
Insert picture description here
$TTL 1D
@ IN SOA tk520.com. admin.tk520.com. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
NS tk520.com.
A 192.168.78.22
66 IN PTR www.tk520.com.
88 IN PTR mail.tk520.com.

➤Start the service and turn off the firewall
systemctl start named
systemctl stop firewalld
setenforce 0
tail /var/log/messages
➤Add the DNS server address
vi /etc/resolv.conf in the domain name resolution configuration file of the client vi /etc/resolv.conf # effective immediately after the modification
nameserver 192.168. 78.22
or
vi /etc/ sysconfig/network- scripts/ ifcfg-ens33 #After the modification, you need to restart the network card
DNS1=192.168.78.22
systemctl restart network ➤Test
Insert picture description here
DNS resolution
host 192.168.78.66
nslookup 192.168.78.88
Insert picture description here

Guess you like

Origin blog.csdn.net/Dark_Tk/article/details/113961001