1. Install CentOS7 (steps omitted)
2. Configure network card information
1. Install vim
- switch root account
sudo su
- install vim
yum install vim
2. Edit the network card configuration file
vim /etc/sysconfig/network-scripts
*Enter i to enter edit mode.
* Press Esc first, then enter: wq to save and exit.
3. Restart the network service and check the status
systemctl restart network
systemctl status network
4. Try to ping the external network
ping baidu.com
3. Use XShell to connect to the server
4. Replace the yum image source (can be skipped)
- Execute the replace command
sudo sed -e 's|^mirrorlist=|#mirrorlist=|g' \
-e 's|^#baseurl=http://mirror.centos.org/centos|baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos|g' \
-i.bak \
/etc/yum.repos.d/CentOS-*.repo
- refresh cache
sudo yum makecache
5. Turn off the firewall
Stop the firewall service: systemctl stop firewalld
close the firewall and start it at boot time: systemctl disable firewalld
check the firewall status:systemctl status firewalld
6. Install FTP server
1. Install required components
yum -y install net-tools
2. Install ftp service
yum -y install vsftpd
3. Modify the ftp service configuration file
vim /etc/vsftpd/vsftpd.conf
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
anon_world_readable_only=YES
Before modification:
After modification:
press Esc, enter: wq to save and exit
4. Turn off the firewall
Check the firewall status to confirm that the firewall is turned off:systemctl status firewalld
5. Restart the ftp service
systemctl restart vsftpd
systemctl status vsftpd
6. Modify system folder permissions
Enter the ftp shared directory: cd /var/ftp
view current permissions: ls -l
modify folder permissions: chmod 777 pub
view current permissions:ls -l
7. Try to access the ftp shared folder
Create file: touch pub/1.txt
Computer access:
Seven, install the DNS server
0. Turn off the firewall
Stop the firewall service: systemctl stop firewalld
close the firewall and start it at boot time: systemctl disable firewalld
check the firewall status:systemctl status firewalld
1. ENSP cloud configuration
- Add host, Cloud
- Configure Cloud and bind ports
Select the UDP network card and the virtual machine network card used by the DNS server, click Add respectively
Configure port mapping, select the two-way channel, click Add
- Host and cloud connection
2. ENSP virtual host configuration
- Configure host IP, DNS points to DNS server
- Verify the external network connectivity of the virtual host.
Use the physical host to try to ping Baidu to obtain Baidu's IP address.
Use the virtual host to directly ping Baidu's ip address.
- Verify that the virtual host DNS server is unavailable
3. Install the components required by the DNS service
Install DNS service components
yum -y install bind-chroot
4. Modify the main configuration file
vim /etc/named.conf
Before modification: After
modification:
Click Esc, enter to :wq
save and exit
5. Modify the zone configuration file
vim /etc/named.rfc1912.zones
Before modification:
After modification:
Enter :wq
to save and exit
6. Modify the forward zone configuration file
Enter the zone file directory, rename the forward zone configuration file, and modify the forward configuration file.
cd /var/named
mv named.localhost zhangsan.com.zone
vim zhangsan.com.zone
Before modification:
After modification:
7. Modify the reverse zone configuration file
Enter the zone file directory, rename the reverse zone configuration file, and modify the reverse configuration file.
cd /var/named
mv named.loopback 192.168.246.arpa
vim 192.168.246.arpa
Before modification:
After modification:
8. Add forwarder configuration and modify security configuration
Modify the zone configuration file, add options to the forwarder configuration, turn off DNS security extension on line 35, and turn off DNS security authentication on line 36.
vim /etc/named.conf
Before modification:
After modification:
9. Restart the service and view the service status
systemctl restart named
systemctl status named
10. Verify DNS service
Use the virtual host to ping Baidu and the domain name configured by yourself. Baidu can ping successfully. The IP corresponding to the domain name has no host, so the display is unreachable, but you can verify that the DNS domain name resolution service is working normally.