Centos7 build DNS service

Install bind software through yum (included in the system disk)

The main configuration file of DNS (bind) is etc/named.conf/, enter the configuration

The following is the meaning of each configuration item

The area configuration content in the main configuration file is as follows

The above is a forward analysis and the other is a reverse analysis, depending on your needs
The next step is to configure the area data file. The default location is stored in /var/named.
Create a new text

After entering, enter r /var/named/named.localhost in the last line mode

Enter the data content of the area on the bottom line

Then create a new zone data file for the reverse zone

Repeat the technique and copy the contents of the file

After finishing, enter the host record

After all configuration files are written, you can use the following commands to check all DNS-related configuration files. If there are syntax errors, they will be pointed out in turn

If there is no problem, you can enter systemctl start named to start the DNS service
Open client verification [domain name resolution] (https://cloud.tencent.com/product/cns?from=10680)

Next, open a centos 7 to install DNS (bind) service, the configuration file is the auxiliary zone

Change the client's preferred DNS address to the static IP of the secondary zone, and perform nslookup analysis again
If the resolution is successful, the auxiliary zone will be completed, and there will be a benet.com.zone in the slave directory of the auxiliary zone

Type of forwarding
(1) Global forwarding: all local query requests that do not pass the zone definition are forwarded to a certain forwarder

options {
forwarders {0.0.0.0; }; #Specify who the forwarder is
forward only|first; #only means forwarding only; first means forwarding first, if the result is not found, then it will iterate out according to the root prompt.
};

E.g:

forward first; #The machine cannot be parsed and forwarded to 202.96.209.5 for analysis #first: forward first; when the forwarder does not respond, iterate the query by itself; only: only forward;
forwarders {
202.96.209.5;
210.22.84.3;
202.96.209.133;
223.5.5.5;
};

(2) Partial forwarding: only forwarding the analysis request for a specific area
zone {
forwarders {ip; }; #Specify who the forwarder is
forward only|first; #only means forwarding only; first means forwarding first, if the result is not found, then it will iterate out according to the root prompt.
};
E.g:

root@DNS-Slave chroot]#vim /etc/named.rfc1912.zones
zone "google.com.hk" IN {
type forward;
forward only;
forwarders { 8.8.8.8; };
};

Recommended Posts

Centos7 build DNS service
CentOs7.3 build Solr stand-alone service
CentOs7.3 build RabbitMQ 3.6 stand-alone service
CentOs7.3 build ZooKeeper-3.4.9 stand-alone service
CentOs7.3 build SolrCloud cluster service
Centos build lnmp
Build WeChat applet service based on CentOS
Build WeChat applet service based on CentOS
CentOS7 build gerrit code review service method
CentOS7.3 64 bit, build Zabbix3.4
CentOS build private git
CentOS 8 enable NTP service
Linux (centos7) build gitlab
Build k8s1.9.9 on centos7
CentOS6.7 build LNMP environment
CentOS 7 install Docker service
Centos7.6 build LNMP environment
CentOS 7 deploys RabbitMQ service
CentOS 7 deploy saltstack service
Centos7 build Kubernetes cluster
Centos7 tutorial to build a master-slave DNS server
Jenkins build on centos
CentOS7 deploys NFS service
Centos6.8 deploy vnc service
CentOS 7 build LNMP environment
CentOS7 deploy vsftp (FTP) service
Build docker environment under Centos6.5
Build OpenV** Server under CentOS7
Build zabbix monitoring zabbix4.2 in CentOS7.6
Build OpenLDAP server under CentOS7
Build MariaDB replication on CentOS
Centos7.2 deployment vnc service record
DNS service construction under Ubuntu
Centos 7 install jdk and package service service
CentOS 7 set up NTP, SSH service
CentOS 8 (2)
CentOS8.1 build Gitlab server detailed tutorial
CentOS builds a cloud service platform
CentOS 8 - install and configure NFS service
Build an FTP server under centos7
CentOS 8 (1)
Build Elasticsearch 6.2.4 (centos) based on docker
CentOS 7 Tomcat service installation and configuration
(centos7) linux build nginx load balancing build
Centos7 build java web server tomcat
Build Discuz Forum based on CentOS
Build Yum private warehouse in Centos7.3
virtualBox install centos, and build tomcat
Centos7 uses vim to build powerful pyt
How to build nfs service on ubuntu16.04
CentOS8 deploys KMS service to activate Office
CentOS7 build FastDFS distributed file system (on)
Create CentOS Docker image with httpd service
(1) Centos7 installation to build a cluster environment
[PHP] Build a PHP operating environment under CentOS
CentOS7 build FastDFS distributed file system (below)