Get the App
SLTechnology News&Howtos  ›  Servers  › 

Separation and parsing of DNS on Centos7 based on VMware (details + diagram)

Shulou Source: shulou.com Published: 2022-06-02 12:07:01 09月18日 Update

I. definition of DNS separation resolution

DNS separation resolution means that the same domain name of the internal and external network is resolved into different IP addresses. In order to give users a better experience and faster parsing speed, some e-commerce websites in the real network parse users from different operators to corresponding servers, which greatly improves the access speed.

II. Purpose of the experiment

Separate parsing of DNS is used to achieve the purpose of load balancing when different clients visit websites and resolve them to different hosts.

III. Specific requirements of the experiment

1. Three hosts (host mode only). The specific functions are:

Centos7 (DNS server, gateway), 192.168.100.100 (local area network test client), 12.0.0.12 (wide area network test client)

2. Implement the DNS server on Centos7 to realize that when the client is a WAN, the resolution result of any domain name is 12.0.0.1.

four。 Experimental procedure

1. Open the centos7 virtual machine to enter the terminal and install the bind package

Yum install bind-y

two。 Create a new network card (for the settings of dual network cards, please refer to the previous LInux network foundation section.

3. Configure the original first network card with the address 192.168.100.1 as the gateway of the LAN

Vim ifcfg-ens33

4. Configure the new network card with the address 12.0.0.1 as the gateway for the WAN

Vim ifcfg-ens36

5. Restart the service

Systemctl restart network

6. Assign addresses to LAN clients

7. Assign addresses to WAN clients

8. Enter Centos7 to modify the dns main configuration file

Vim / etc/named.conf

9. Modify the zone configuration file and delete the following

Vim / etc/named.rfc1912.zones

10. Cut the configuration of the root server in the main configuration file to the zone configuration file

11. Copy 2 regional data file configuration templates

Cd / var/named

Cp-p named.localhost kgc.com.lan

Cp-p named.localhost kgc.com.wan

twelve。 Modify zone data configuration file (lan)

Vim kgc.com.lan

13. Modify zone data configuration file (wan)

Vim kgc.com.wan

14. Turn off the firewall and turn on the service

Systemctl stop firewalld.service

Setenforce 0

Systemctl start named

15. Verification

Wan resolution is the address of the gateway (public network)

Address of private network parsed by local area network

Tags: Configuration address file client client service region different local area local area network wide area network server gateway network card host data experiment domain name user purpose Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi macOS Docker MySQL OPPO Reno