Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Subdomain authorization

Shulou Source: shulou.com Published: 2022-06-01 04:09:08 10月04日 Update

Authorize child domains on the parent domain .ocm-- > mageedu.com

Mageedu IN NS ns1.mageedu.com.

IN NS ns2.mageedu.com.

Ns1.mageedu.com IN A 192.168.100.1

Ns2.mageedu.com IN A 192.168.100.2

Now I want to authorize a subdomain called fin and one called market: (may not be in a network segment)

Fin.mageedu.com. IN NS ns1.fin.magedu.com.

Ns1.fin.magedu.com. IN A 192.168.100.3

(you can also create two name servers for fin; the above letter replication only needs to be changed to IP)

Market IN NS ns1.market.mageedu.com.

Ns1.market.mageedu.com. IN A 192.168.9.4

# # #

Vim / var/named/mageedu.com.zone edit this field

Fin IN NS ns1.fin (as long as you write NS, you will know it is a subdomain)

Ns1.fin IN A 192.168.100.3

Market IN NS ns1.market.mageedu.com.

Ns1.market.mageedu.com. IN A 192.168.9.4

Modify serial number + 1

Service named restart restart

@ @ 2

Clone a virtual machine

Configure the IP address to 9.4

0. Set the IP DNS server to point to itself, and the search domain is fin.mageedu.com

Restart the network

1 、 vim / etc/named.conf

2. Leave named.ca;named.localhost;named.loopback

3. Zone "fin.mageedu.com" IN {

Type master

File "fin.mageedu.com.zone"

}

4. Cd / var/named;; mv mageedu.com.zone fin.mageedu.com.zone

5. Editor: $TTL 86400

@ IN SQA ns1.fin.mageedu.com admin.fin.mageedu.com. (

2013040201

2H

10M

7D

2D)

IN NS ns1

IN MX 10 mail

Ns1 IN A 192.168.9.3

Mail IN A 192.168.9.4

Www IN A 192.168.9.5

Wq restarts the network

6. Dig-t A www.fin.mageedu.com @ 192.168.9.3

7. Dig-t ns1.fin.mageedu.com @ 192.168.9.1 on the parent domain

You will see that there is a subdomain 9.3

# # #

Enable the parent domain to forward for the child domain

Fill in under the options option in the configuration file of the subdomain

Forward first;, if you forward it, you forward it. If you don't forward it, I'll find the root.

Forwarders {172.16.100.1;}; forward to the server 100.1

Restart the service

* *

Now I want to implement: if it is a request for mageedu.com, the domain will be forwarded to the parent domain, and nothing else will be forwarded.

Vim / etc/named.conf

Remove forward and forwarders from options

Add a set of zone "mageedu.com" IN {

Type forward

Forward first

Forwarders {172.16.100.1;}

}

Named-checkconf

Restart

# #

Check the IP address of com

Dig-t NS com

Tags: Subdomain service server address network configuration two name sequence serial number I want point file network segment face plus one search Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Shulou Information Xiaomi Shulou Technology MySQL