CentOS7 installs FTP/DNS server

1. Install CentOS7 (steps omitted)

2. Configure network card information

1. Install vim

  1. switch root account
sudo su
  1. install vim
yum install vim

insert image description here

2. Edit the network card configuration file

vim /etc/sysconfig/network-scripts

insert image description here
*Enter i to enter edit mode.
insert image description here
* 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

insert image description here

4. Try to ping the external network

ping baidu.com

insert image description here

3. Use XShell to connect to the server

insert image description here
insert image description here
insert image description here
insert image description here

4. Replace the yum image source (can be skipped)

  1. 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
  1. 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

insert image description here

2. Install ftp service

yum -y install vsftpd

insert image description here

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: insert image description here
After modification:
insert image description here
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

insert image description here

5. Restart the ftp service

systemctl restart vsftpd
systemctl status vsftpd

insert image description here

6. Modify system folder permissions

Enter the ftp shared directory: cd /var/ftp
view current permissions: ls -l
insert image description here
modify folder permissions: chmod 777 pub
view current permissions:ls -l
insert image description here

7. Try to access the ftp shared folder

Create file: touch pub/1.txt
Computer access:
insert image description here

insert image description here
insert image description here

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
insert image description here

1. ENSP cloud configuration

  1. Add host, Cloud
    insert image description here
  2. Configure Cloud and bind ports
    Select the UDP network card and the virtual machine network card used by the DNS server, click Add respectively
    insert image description here
    Configure port mapping, select the two-way channel, click Add
    insert image description here
  3. Host and cloud connection

2. ENSP virtual host configuration

  1. Configure host IP, DNS points to DNS server
    insert image description here
  2. 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.
    insert image description here
  3. Verify that the virtual host DNS server is unavailable
    insert image description here

3. Install the components required by the DNS service

Install DNS service components

yum -y install bind-chroot

insert image description here

4. Modify the main configuration file

vim /etc/named.conf

insert image description here
Before modification: After
insert image description here
modification:
insert image description here
Click Esc, enter to :wqsave and exit

5. Modify the zone configuration file

vim /etc/named.rfc1912.zones

insert image description here
Before modification:
insert image description here
After modification:
insert image description here
Enter :wqto 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

insert image description here
Before modification:
insert image description here
After modification:
insert image description here

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

insert image description here
Before modification:
insert image description here
After modification:
insert image description here

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

insert image description here

Before modification:
insert image description here
After modification:
insert image description here

9. Restart the service and view the service status

systemctl restart named
systemctl status named

insert image description here

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.
insert image description here

Guess you like

Origin blog.csdn.net/m0_50089886/article/details/129788063