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