Configuration domain master server stage: 1. add the domain in the main configuration file of bind 2. create the zone file for this domain in/var/named. edit the zone file and add the required information. 4. detection firewall or selinux settings 5. start the bind service 6. run the host or nslookup command to check whether bindyumi is installed properly.
Configure the domain master server
Phase:
1. add the domain to the bind main configuration file
2. create the zone file for this domain in/var/named.
3. edit the zone file and add the required information.
4. check firewall or selinux settings
5. start the bind service
6. run the host or nslookup command to check whether the domain information is normal.
Install bind
Yum install-y bind-chroot bind-utils
The BIND configuration file is saved in:
/Etc/named. conf main configuration file
/Var/named/domain zone file location
Modify the main configuration file
Vim/etc/named. conf (for example, 1)
After modification, save and exit.
Configure the zone file
Modify the zone configuration fileVim/etc/named. rfc1912.zones (for example, 2)
Configure forward resolution (e.g)
Cd/var/named/
Cp named. localhost helome.com. zone
Vim helome.com. zone(It must be consistent with the zone file name defined in the main configuration file)
Configure reverse resolution (for example, 2)
Cp named. localhost 32.16192.zone
Vim 32.16192.zone
Save and exit!
Change firewall settings and selinux settings
Getenforce
Setenforce 0
Iptables-F(As shown in) orVim/etc/sysconfig/iptables# Configure the firewall port (as shown in Figure 2)
-AINPUT-m state -- state NEW-m tcp-p tcp -- dport 53-j ACCEPT
-AINPUT-m state -- state NEW-m udp-p udp -- dport 53-j ACCEPT
-AINPUT-m state -- state NEW-m tcp-p tcp -- dport 953-j ACCEPT
Service iptables save
Service iptables restart# Restart the firewall to make the rules take effect
Start bind
Service named start
Modify the/etc/resolv. conf file
Vim/etc/resolv. conf
Test whether domain information is normal
Check whether the configuration file has the read permission.Ll/var/named(If noChmod + r/var/named /*)
Use the host or nslookup command to check whether the domain information is normal, as shown in)
Host mail.helome.com
Nslookup mail.helome.com
The establishment of the DNS server is complete.
Error-prone during bind file configuration
Run the following command to check the bind configuration file and zone file syntax:
Named-checkconf/etc/named. conf
Named-checkzone helome.com/var/named/helome.com. zone
Check whether the configuration file has read permission.