Get the App
SLTechnology News&Howtos  ›  Servers  › 

Linux server DNS service building (forward parsing, reverse parsing)

Shulou Source: shulou.com Published: 2022-06-03 06:17:43 10月04日 Update

Detailed explanation of the experiment:

Experiment content: DNS forward parsing and reverse parsing services are simulated in the virtual machine and built in centos7.

Experimental environment: a linux server, bind tool

The process of the experiment:

Forward parsing:

1. Open a Linux server and use yum warehouse to install BIND tool to build a domain name server.

[root@localhost ~] # yum install bind-y install bind tool

[root@localhost ~] # rpm-qc bind View configuration file

2. Configure the main configuration file, modify the listen-on address, and access permissions

[root@localhost ~] # vim / etc/namde.conf configuration main configuration file

3. Configure the zone configuration file, add the domain name to be resolved, and the path where the zone data configuration file is located

[root@localhost ~] # vim / etc/named.rfc1912.zones configuration zone configuration file

4. Copy the zone data configuration file (named.localhost) that comes with the system to the zone data file (kgc.com.zone/yun.com.zone) that you want to parse your own configuration.

Be careful to retain the original permissions, and then go to your area data file to edit and configure your parsing data.

[root@localhost ~] # cd / var/named/

[root@localhost ~] # cp-p named.localhost kgc.com.zone retains the original permission to copy to kgc.com.zone

[root@localhost ~] # vim kgc.com.zone

[root@localhost ~] # cp-p named.localhost yun.com.zone retains the original permission to copy to yun.com.zone

5. Turn off the firewall and the features that enhance security.

[root@localhost named] # systemctl stop fi rewalld. Service, turn off the firewall

[root@localhost named] # setenforce 0 turns off the enhanced security feature

6. Start named service, open port 53, and provide dns resolution service to other users.

[root@localhost named] # systemctl start named starts the named service

7. Write the resolution address (local address) to the file / etc/resolv.conf written by dns

[rootloca lhost named] # echo "nameserver 192.168.100.100" > etc/ resolv. Conf adds a resolution address to the file written by DNS

8. The forward parsing of dns is completed, and the local test is conducted to see if the experiment is successful. Use the host command.

Reverse parsing

1. Modify the configuration file of the configuration area, copy and paste the reverse parsing template into the blank, and modify it. You only need to modify it in two places. Unlike the forward direction, the address or network segment is written backwards. 100.168.192

Tags: Configuration files services areas addresses data labs permissions servers tools security functions domain names security firewalls firewalls differences success repositories content Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Shulou Technology Shulou Tech Info Huawei OPPO Reno