Forward parsing script for shell
Forward parsing script #! / bin/bashyum install bind-y / / install parsing toolkit / / modify the main configuration file sed-I '13sUniple 127.0.0.1 etc/named.conf / / change the IP address on line 13 of the parsing main configuration file to 192.168.17.156sed-I '21slocalhosthand anyhand' / etc/named.conf / / change the main configuration file Replace line 21 localhost with any// to add content to the zone configuration file sed-I '24azone "cwq.com" IN {\ n type master \ nfile "cwq.com.zone";\ nallow-update {none;};\ n} Add the domain name cd / var/named cp-p named.localhost cwq.com.zone / / copy template to our own data region configuration file / / configure the data region configuration file sed-I'2s cwq.com.zonesed after line 24 of the / cwq.com.zonesed zone configuration file. -I '8s 10aIN MX 10aIN MX cwq.com.Universe 'cwq.com.zonesed-I' 9s cwq.com.zonesystemctl stop firewalld.service 127.0.0.1On192.168.17.156 @ cwq.com.zonesed-I 'Universe 10 mail.cwq.com.\ nwww IN A 192.168.100.99\ nftp IN A 192.168.100.88' cwq.com.zonesystemctl stop firewalld.service / / turn off firewall setenforce 0 / / turn off the enhanced systemctl start named / / enable parsing service Echo "nameserver 192.168.17.156" > / etc/resolv.conf / / add your own Ip address to the resolution configuration file. Finally, just type hosts www.cwq.com to resolve the address 192.168.17.156.