Implementation of shell forward parsing script

Time:2020-10-28

Forward parsing script

#!/bin/bash
Yum install bind - Y // install parsing Toolkit
//Modify master profile

sed -i '13s/127.0.0.1/192.168.17.156/' /etc/ named.conf  //Change the IP address on line 13 of the main configuration file to 192.168.17.156
sed -i '21s/localhost/any/' /etc/ named.conf   //Change the 21 line localhost to any in the main configuration file
//Add content to zone profile

sed -i '24azone "cwq.com" IN {\n type master;\n file "cwq.com.zone";\n allow-update { none; };\n };' /etc/named.rfc1912.zones
//Add domain name after line 24 of regional configuration file
cd /var/named  
cp -p  named.localhost  cwq.com.zone   //Copy the template to our own data area profile
//Configure data area profile

sed -i '2s/@/cwq.com/2' cwq.com.zone 
sed -i '2s/rname.invalid./admin.cwq.com/' cwq.com.zone
sed -i '8s/@/cwq.com./' cwq.com.zone
sed -i '9s/127.0.0.1/192.168.17.156/' cwq.com.zone
sed -i '10aIN MX 10 mail.cwq.com.\nwww IN A 192.168.100.99\nftp IN A 192.168.100.88' cwq.com.zone
systemctl stop  firewalld.service  //Turn off the firewall
Setenforce 0 // turn off enhancements
Systemctl start named // start the resolution service
echo "nameserver 192.168.17.156" >/etc/ resolv.conf  //Add your IP address to the resolution profile

Finally, just enter hosts www.cwq.com You can resolve the address 192.168.17.156

The above is the whole content of this article, I hope to help you in your study, and I hope you can support developeppaer more.

Recommended Today

mediaaccess.exe What process is used to query mediaaccess process

Process file: mediaaccess or mediaaccess.exeProcess name: windupdate media access adwareProcess category: processes with security risks English Description:mediaaccess.exe is an advertising program by Windupdate. This process monitors your browsing habits and distributes the data back to the authors servers for analysis. This also prompts advertising popups. This program is a registered security risk and s Chinese […]