DNS subdomain authorization and DNS isolation resolution

Source: Internet
Author: User

Lab environment:

------- Rhel5.10 (vmnet1) ---------- rel5.10 (vmnet1)

(192.168.100.10 main domain) (192.168.100.20 subdomain)


[DNS subdomain authorization configuration]

Operation above kvm_node2 (subdomain:

[[Email protected] ~] # Yum-y install bind-chroot caching-nameserver

[[Email protected] ~] # Cd/var/named/chroot/etc/

[[Email protected] etc] # Vim named. rfc1912.zones

...

51 zone "sh.tarena.com" in {

52 type master;

53 file "sh.tarena.com. Zone ";

54 allow-transfer {none ;};

55 };

[[Email protected] etc] # cd/var/named/chroot/var/named/

[[Email protected] named] # cp-P named. Zero sh.tarena.com. Zone

[[Email protected] named] # Cat sh.tarena.com. Zone

$ TTL 86400

@ In SOA dns1.sh.tarena.com. root.sh.tarena.com .(

2014062401; Serial (D. Adams)

3 h; refresh

15 m; retry

1 W; expiry

1D); Minimum

In NS dns1.sh.tarena.com.

Dns1 in a 192.168.100.20

WWW in a 192.168.100.100

[[Email protected] named] # service named restart


Kvm_node1 (parent domain:

[[Email protected] ~] # Yum-y install bind-chroot caching-nameserver

[[Email protected] ~] # Cd/var/named/chroot/var/named/

[[Email protected] named] # Cat tarena.com. Zone

$ TTL 86400

@ In SOA dns1.tarena.com. root.tarena.com .(

2014062401; Serial (D. Adams)

3 h; refresh

15 m; retry

1 W; expiry

1D); Minimum

In NS dns1.tarena.com.

Sh.tarena.com. In NS dns1.sh.tarena.com.

Dns1.sh.tarena.com. In a 192.168.100.20

Dns1 in a 192.168.100.10

[[Email protected] named] # service named restart

Test:

[[Email protected] ~] # Host www.sh.tarena.com 192.168.100.10



In turn, the client DNS points to the subdomain and resolves the parent domain entries.

[[Email protected] named] # Vim/var/named/chroot/etc/named. conf

21 forwarders {192.168.100.10 ;};

[[Email protected] named] # service named restart


Test:

[[Email protected] ~] # Host www.tarena.com 192.168.100.20

Using Domain Server:

Name: 192.168.100.20

Address: 192.168.100.20 #53

Aliases:


Www.tarena.com has address 192.168.100.1



DNS isolation resolution/View]

Determine different source addresses access the same domain name for different resolution results


[[Email protected] ~] # Cd/var/named/chroot/etc/

[[Email protected] etc] # Vim named. conf

...

15 listen-on port 53 {192.168.100.10 ;};

16 // listen-on-v6 port 53 {: 1 ;};

...

27 allow-query {Any ;};

28 allow-query-Cache {Any ;};

...

36 view lt {

37 match-clients {192.168.100.20 ;};

38 Match-destinations {Any ;};

39 recursion yes;

40 include "/etc/named. rfc1912.zones ";

41 };

42

43 view YD {

44 match-clients {Any ;};

45 match-destinations {Any ;};

46 recursion yes;

47 include "/etc/named. rfc1913.zones ";

48 };

[[Email protected] etc] # cp-P named. rfc1912.zones named. rfc1913.zones

[[Email protected] etc] # Vim named. rfc1912.zones

...

51 zone "tarena.com" in {

52 type master;

53 file "lt.tarena.com. Zone ";

54 allow-transfer {none ;};

55 };

[[Email protected] etc] # Vim named. rfc1913.zones

51 zone "tarena.com" in {

52 type master;

53 file "yd.tarena.com. Zone ";

54 allow-transfer {none ;};

55 };

[[Email protected] etc] # cd/var/named/chroot/var/named/

[[Email protected] named] # cp-P named. Zero lt.tarena.com. Zone

[[Email protected] named] # cp-P named. Zero yd.tarena.com. Zone

[[Email protected] named] # Cat lt.tarena.com. Zone

$ TTL 86400

@ In SOA dns1.tarena.com. root.tarena.com .(

2014062401; Serial (D. Adams)

3 h; refresh

15 m; retry

1 W; expiry

1D); Minimum

In NS dns1.tarena.com.

Dns1 in a 192.168.100.10

WWW in a 1.1.1.1

[[Email protected] named] # Cat yd.tarena.com. Zone

$ TTL 86400

@ In SOA dns1.tarena.com. root.tarena.com .(

2014062401; Serial (D. Adams)

3 h; refresh

15 m; retry

1 W; expiry

1D); Minimum

In NS dns1.tarena.com.

Dns1 in a 192.168.100.10

WWW in a 2.2.2.2

[[Email protected] named] # service named restart


Test:

Test with 192.168.100.20 and other clients respectively



This article from the "Zhou min" blog, please be sure to keep this source http://zhmin.blog.51cto.com/5402080/1431368

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.