Bo's Oracle Station

查看: 1420|回复: 0

课程第15次:2020-03-09星期一

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2020-3-9 19:55:07 | 显示全部楼层 |阅读模式
1.BIND
  1. [root@classroom named]# yum list "bind*"
  2. Updating Subscription Management repositories.
  3. Unable to read consumer identity
  4. This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
  5. Last metadata expiration check: 0:54:24 ago on Mon 09 Mar 2020 08:07:13 PM CST.
  6. Installed Packages
  7. bind.x86_64                    32:9.11.4-16.P2.el8                    @AppStream
  8. bind-dyndb-ldap.x86_64         11.1-13.module+el8+2555+b334d87b       @AppStream
  9. bind-export-libs.x86_64        32:9.11.4-16.P2.el8                    @anaconda
  10. bind-libs.x86_64               32:9.11.4-16.P2.el8                    @AppStream
  11. bind-libs-lite.x86_64          32:9.11.4-16.P2.el8                    @AppStream
  12. bind-license.noarch            32:9.11.4-16.P2.el8                    @AppStream
  13. bind-pkcs11.x86_64             32:9.11.4-16.P2.el8                    @AppStream
  14. bind-pkcs11-libs.x86_64        32:9.11.4-16.P2.el8                    @AppStream
  15. bind-pkcs11-utils.x86_64       32:9.11.4-16.P2.el8                    @AppStream
  16. bind-utils.x86_64              32:9.11.4-16.P2.el8                    @AppStream
  17. Available Packages
  18. bind-chroot.x86_64             32:9.11.4-16.P2.el8                    AppStream
  19. bind-devel.i686                32:9.11.4-16.P2.el8                    AppStream
  20. bind-devel.x86_64              32:9.11.4-16.P2.el8                    AppStream
  21. bind-export-devel.i686         32:9.11.4-16.P2.el8                    BaseOS   
  22. bind-export-devel.x86_64       32:9.11.4-16.P2.el8                    BaseOS   
  23. bind-export-libs.i686          32:9.11.4-16.P2.el8                    BaseOS   
  24. bind-libs.i686                 32:9.11.4-16.P2.el8                    AppStream
  25. bind-libs-lite.i686            32:9.11.4-16.P2.el8                    AppStream
  26. bind-lite-devel.i686           32:9.11.4-16.P2.el8                    AppStream
  27. bind-lite-devel.x86_64         32:9.11.4-16.P2.el8                    AppStream
  28. bind-pkcs11-devel.i686         32:9.11.4-16.P2.el8                    AppStream
  29. bind-pkcs11-devel.x86_64       32:9.11.4-16.P2.el8                    AppStream
  30. bind-pkcs11-libs.i686          32:9.11.4-16.P2.el8                    AppStream
  31. bind-sdb.x86_64                32:9.11.4-16.P2.el8                    AppStream
  32. bind-sdb-chroot.x86_64         32:9.11.4-16.P2.el8                    AppStream
复制代码

1.1/etc/named.conf:
  1. acl exampleNetwork { 192.168.0.0/24; };
  2. acl crackerNetwork { 192.168.1.0/24; };
  3. acl internal       { 127.0.0.1; 192.168.0.0/24; 192.168.1.0/24; };
  4. acl bogusNets      { 0.0.0.0/8;
  5.                      1.0.0.0/8;
  6.                      2.0.0.0/8;
  7.                      192.0.2.0/24;
  8.                      224.0.0.0/3;
  9.                      10.0.0.0/8;
  10.                      172.16.0.0/12;
  11. };
复制代码

  1. options {
  2.         // Where do our zone files live?
  3.         directory "/var/named";

  4.         cleaning-interval 1440;
  5.         // Use the ACL to say who can query us
  6.         allow-query { internal; };

  7.         // Allow recursion for localnets( not really needed becauses of above )
  8.         allow-recursion { internal; };

  9.         // Allow zone transfers only to exampleNetwork ACL
  10.         allow-transfer { exampleNetwork; };
复制代码
RFC 1033:
  1. zone "localhost" {
  2.         type master;
  3.         file "localhost.zone";
  4. };

  5. zone "0.0.127.in-addr.arpa" {
  6.         type master;
  7.         file "127.0.0.zone";
  8. };

  9. ########################################################################
  10. #
  11. #   Provide a hint to the root nameservers
  12. #
  13. ########################################################################

  14. zone "." {
  15.         type hint;
  16.         file "named.ca";
  17. };
复制代码
zone "." {
type hint;
file "named.ca";
};

named.ca:从IETF那里下载,格式千年不变。
---------------------------------------------------------------------
localhost.zone 可以作为正向域模版:
  1. $TTL    86400
  2. @               IN SOA  @       root (
  3.                                         42              ; serial (d. adams)
  4.                                         3H              ; refresh
  5.                                         15M             ; retry
  6.                                         1W              ; expiry
  7.                                         1D )            ; minimum

  8.                 IN NS           @
  9.                 IN A            127.0.0.1
  10.                 IN AAAA         ::1
复制代码
改成:
  1. ; Specify the time-to-live( TTL ) for the zone
  2. $TTL 86400  ; 1 Day ( we could have used 1D )

  3. ; Begin Start Of Authority resource record
  4. <span id="kM0.68121787631263">@  </span> IN  SOA classroom.example.com. root.classroom.example.com. (
  5.                                 2003040100      ; serial number
  6.                                 1H              ; refresh slave
  7.                                 5M              ; retry query
  8.                                 1W              ; expire
  9.                                 1M              ; negative TTL
  10. )

  11. ; Specify our name servers
  12. ; !!WARNING: You can not use CNAMEs for RDATA here !!
  13. ; owner                 TTL     CL  type                RDATA
  14. @                               IN  NS          classroom.example.com.

  15. ; Specify our mail exchangers
  16. ; !!WARNING: You can not use CNAMEs for RDATA here !!
  17. ; owner                 TTL     CL  type        RDATA
  18. @                               IN  MX          10  classroom.example.com.

  19. ; This is broken and against RFC but must be done to placate the masses
  20. ; owner                 TTL     CL  type        RDATA
  21. <span id="kM0.5938425035902726">@  </span>                  IN  A           192.168.0.254



  22. classroom.example.com.                               IN  A           192.168.0.254
复制代码
关于@为什么是example.com. :

  1. zone "example.com" {
  2.         type master;
  3.         file "example.com.zone";
  4.         // The forwarders line below turns off forwarding, if specified
  5.         // above, for delegated subdomains (domainXX.example.com, etc).
  6.         // (So we talk directly to the server for the zone we delegated,
  7.         // rather than asking the forwarder to do it for us.)
  8.         forwarders {};
  9. };

  10. zone "0.168.192.in-addr.arpa" {
  11.         type master;
  12.         file "192.168.0.zone";
  13.         forwarders {};
  14. };
复制代码
上面每个file里面的@ 就是指zone的名字。

HOMEWOEK : 配置SCAN:
  1. scan4      0                    IN  A           192.168.0.204
  2. scan4      0                    IN  A           192.168.0.154
  3. scan4      0                    IN  A           192.168.0.54
复制代码

127.0.0.zone作为模版:
  1. $TTL 86400
  2. @ IN  SOA localhost. root.localhost. ( 2001101100 28800 14400 604800 0 )

  3.   IN  NS  localhost.

  4. 1.0.0.127.IN-ADDR.ARPA.    IN  PTR    localhost.
复制代码

改成:
  1. ; Specify the time-to-live( TTL ) for the zone
  2. $TTL 86400  ; 1 Day ( we could have used 1D )

  3. ; Begin Start Of Authority resource record
  4. 0.168.192.IN-ADDR.ARPA. IN  SOA classroom.example.com. root.classroom.example.com.(
  5.                                 2003040100      ; serial number
  6.                                 1H              ; refresh slave
  7.                                 5M              ; retry query
  8.                                 1W              ; expire
  9.                                 1M              ; negative TTL
  10. )

  11. ; Specify our name servers
  12. ; !!WARNING: You can not use CNAMEs for RDATA here !!
  13. ; owner                 TTL     CL  type        RDATA
  14. @                               IN  NS          classroom.example.com.

  15. ; List our PTR records ( rev lookup ) here
  16. ; owner                 TTL     CL  type        RDATA
  17. 1.0.168.192.IN-ADDR.ARPA.       IN  PTR         desktop1.example.com.
  18. 2                               IN  PTR         desktop2.example.com.
  19. 3                               IN  PTR         desktop3.example.com.
  20. 4                               IN  PTR         desktop4.example.com.
  21. 5                               IN  PTR         desktop5.example.com.
  22. 6                               IN  PTR         desktop6.example.com.
  23. 7                               IN  PTR         desktop7.example.com.
  24. 8                               IN  PTR         desktop8.example.com.
  25. 9                               IN  PTR         desktop9.example.com.
  26. 10                              IN  PTR         desktop10.example.com.
  27. 11                              IN  PTR         desktop11.example.com.
  28. 12                              IN  PTR         desktop12.example.com.
  29. 13                              IN  PTR         desktop13.example.com.
  30. 14                              IN  PTR         desktop14.example.com.
复制代码









回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-5-9 14:08 , Processed in 0.038650 second(s), 24 queries .

快速回复 返回顶部 返回列表