Get the App
SLTechnology News&Howtos  ›  Servers  › 

DNS server

Shulou Source: shulou.com Published: 2022-06-02 02:20:21 10月03日 Update

Recursive parsing sends a request to the root server, which parses, and then caches the parsing record locally.

Iterative parsing sends a request to the root server. The root server gives you the IP of a subordinate server, and you parse it from this IP.

Parse the record:

A resolution of domain name A to IP

NS is used to specify which DNS server will resolve the domain name. Fill in the IP address or name of the resolution server.

MX mail records should be used as mail servers, and both An and MX records should be made.

Alias format for CNAME domain name: CMAKE

Set up DNS domain name server, for parsing, for caching

Install bind*

The configuration file is in / etc/named.conf

Dns uses a tcp/udp53 port

Listen-on port 53; listen-on-v6 port 53; allowbenefit query; all three lines are changed to any

/ etc/named.rfc1912.zones this is the main configuration file

To add a domain name, copy a zone

# add named by wugk

Zone "wugk.com" IN {

Type master

File "wugk.com.zone"

Allow-update {none;}

}

Zone "1.168.192.in-addr.arpa" IN {

Type master

File "wugk.com.arpa"

Allow-update {none;}

}

1) add the following files to the / var/named/ directory:

The contents of the Wugk.com.zone forward parsing file are as follows:

$TTL 86400

@ IN SOA ns.wugk.com. Root (

42; serial

3H; refresh

15m; retry

1W; expire

1D); minimum

@ IN NS ns.wugk.com.

Ns IN A 192.168.1.36

Bbs IN A 192.168.1.36

Www IN A 192.168.1.36

@ IN MX 10 mail.wugk.com.

Mail IN A 192.168.1.36

Ns is to mark you this is a DNS server, the front @ is to give a name to the ns server, @ is a zone, indicating ns.wugk.com. Is resolved to 192.168.1.24

Do not write @ or www in front of it, write it as *, then no matter what others access the prefix, it will resolve to this domain name.

The contents of the Wugk.com.arpa reverse parsing file are as follows:

$TTL 86400

@ IN SOA ns.wugk.com. Root (

42; serial

3H; refresh

15m; retry

1W; expire

1D); minimum

@ IN NS ns.wugk.com.

36 IN PTR mail.wugk.com.

36 IN PTR ns.wugk.com. Note that this one is about ns server.

36 IN PTR www.wugk.com.

What is written here is the last bit of IP. Generally, there is no reverse parsing in public network, so it is enough to write forward.

Then restart, / etc/init.d/named restart

Then change the client NDSip to 192.168.1.36 vim / etc/resolv.conf

You can ping www.wugk.com.

If you want to add another domain name

Nslookup www.baidu.com

Name NS server

IP parsed by Address

Name domain name

Address

Dig can see the parsing process.

Tags: Server service domain name file content cache mail configuration alias prefix region name address customer client tag format directory port Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Huawei Microsoft MySQL NVidia