Get the App
SLTechnology News&Howtos  ›  Servers  › 

Centos 7 builds DNS forward parsing and reverse parsing

Shulou Source: shulou.com Published: 2022-06-02 14:56:14 10月05日 Update

Centos 7 builds DNS forward parsing and reverse parsing

Three elements of service: installation-configuration-startup

1. Install DNS using yum

Yum install bind-y

two。 Modify the configuration file

Vi / etc/named.conf modifies the following: listen-on port 53 {any;}; allow-query {any;}; vi / etc/named.rfc1912.zones adds the following at the end: zone "hello.com" IN {- forward parsing type master; file "hello.com.zone";} Zone "80.168.192.in-addr.arpa" IN {- reverse parse type master; file "hello.com.local";}; wq-Save exit cd / var/named/cp-p named.localhost hello.com.zone-copy template

Create a forward parsing file with the same name as your file "hello.com.zone"

Vi hello.com.zone-$TTL 1D @ IN SOA hello.com. 123213123.qq.com (1; serial 1D; refresh 1H; retry 1W; expire 3H) Minimum NS dns.hello.com.dns IN A 192.168.80.100www IN A 192.168.80.101ftp IN A 192.168.80.102

Create a reverse parsing file "hello.com.local" with the same file name

Vi hello.com.local$TTL 1D @ IN SOA hello.com. 12123123.qq.com (0; serial 1D; refresh 1H; retry 1W; expire 3H) Minimum NS dns.hello.com.100 IN PTR dns.hello.com.101 IN PTR www.hello.com.

Check the main profile syntax

Named-checkconf

3. Start the DNS service

Systemctl start named

Check whether the DNS service has been started successfully `netstat-anpt | grep named`

Test DNS service 1. Install the nslookup command `yum install bind-utils-y`2. Specify DNS `vi / etc/sysconfig/network-scripts/ifcfg-ens32 `to the Nic and add the following at the end: ````DNS1=192.168.80.100 (add the DNS address according to the actual situation) wq-Save exit systemc restart network- restart the Nic service 3. Using nslookup to test forward parsing and reverse parsing forward parsing is to resolve the ip address according to the URL

Reverse resolution is to resolve the URL according to the ip address.

Tags: File service content address configuration that is file name end network card URL test success command actual situation template element syntax check Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Shulou Technology Shulou Tech Info vpn Redmi