Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

DNS Domain name Resolution of CentOS 7

2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

1. Brief introduction to DNS:

Domain name system (Domain Name System, abbreviation: DNS) is a service of the Internet. As a distributed database that maps domain names and IP addresses to each other, it makes it more convenient for people to access the Internet. DNS uses TCP and UDP port 53. Currently, the limit for the length of each first-level domain name is 63 characters, and the total length of a domain name cannot exceed 253 characters.

3. Type of DNS:

According to the different sources of regional geological data managed, DNS systems can be divided into different types. The common ones are cached domain name server, master domain name server and slave domain name server.

IV. BIND domain name service

BIND represents the only DNS service program that can provide domain name services, but it is the most widely used, and BIND can run on most Linux/UNIX hosts.

Install and configure DNS service 1. DNS forward parsing

(1) use the yum installation to execute the "yum install bind-y" command on the server to install the BIND package.

(2) execute the "rpm-qc bind" command to see if the installed bind package is complete.

(3) execute the "vim / etc/named.conf" command to enter the master file configuration.

(4) in the master file configuration, change the IP address in the original template to the IP address of the local host, and change the "localhost" in the permission to any to authorize everyone to access it.

(5) then execute the "vim / etc/named.rfc1912.zones" command to enter the zone configuration file.

(6) in the zone configuration file, we can copy a template to rewrite, change the "localhost" in the forward area to "kgc.com", and then change the area data configuration file to "kgc.com.zone".

(7) execute the "cd / var/named/" command to enter the directory of the zone data configuration file, and then execute the "cp-p named.localhost kgc.com.zone" command to retain the original permissions of the copy template file to modify.

(8) execute the "vim kgc.com.zone" command to enter the zone data configuration file.

(9) after entering the zone data configuration file, replace "@" with "kgc.com."

Administrator mailbox; change the ip address to the IP address of the local host; finally delete the rest and enter the host address of the mailbox server, forward resolution entry, alias resolution entry and pan-domain name resolution entry.

(10) execute "systemctl stop firewalled.service" to turn off the firewall, and then execute the "setenforce 0" command to turn off the enhanced security function.

(11) execute the "systemctl start named" command to restart the service, and then execute the "netstat-nuap" command to see if the UDP port 53 for this service is open.

(12) execute "netstat-ntap" to see if the TCP port 53 for this service is open.

(13) execute the command "echo" nameserver 192.168.174.155 "> / etc/resolv.conf" to specify the local host IP address as the DNS server address.

(14) the resolved IP address can be obtained by using the host command.

2. Reverse parsing of DNS

(1) based on the above forward parsing, we execute "vim / etc/named.rfc1912.zones" to enter the zone configuration file again.

(2) in the zone profile, copy the reverse resolution template, fill in the IP address area upside down, and specify the region data profile.

(3) execute the "cp-p kgc.com.zone yun.com.loacl" command to retain the original permission of the copy template file to modify.

(4) execute "vim yun.com.local" to enter the area data file to modify

Replace the original "kgc" with yun; to delete the original parsing entry and enter the reverse parsing entry.

(5) execute "systemctl start named" command to restart the service.

(6) the domain name resolved in reverse can be obtained by using the host command.

3. Master-slave synchronization of DNS (dual-computer hot backup)

(1) also turn off the firewall and security functions on another server, and use the yum installation to execute the "yum install bind-y" command to install the BIND package.

(2) the same access to the main configuration file.

(3) change the IP address to the IP address of the second server in the main configuration file and authorize everyone to access it.

(4) execute "vim / etc/named.rfc1912.zones" to enter the zone configuration file.

(5) copy the forward parsing template in the zone configuration file to modify it, change the type to slave zone slave and specify the download file storage directory, and specify the IP address of the master server.

(6) then go to the main server to modify the zone configuration file.

(7) replace "update" with "transfer" in the zone configuration file of the master server and specify the IP address of the slave server.

(8) execute the "systemctl start named" command to restart the service and you can see the synchronized files.

(9) execute the command "echo" nameserver 192.168.174.151 "> / etc/resolv.conf" to specify the local host IP address as the DNS server address.

(10) finally, use the host command to get the parsing result.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report