Chinaunix首页 | 论坛 | 博客
  • 博客访问: 304242
  • 博文数量: 58
  • 博客积分: 2763
  • 博客等级: 少校
  • 技术积分: 731
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-04 19:07
文章分类

全部博文(58)

文章存档

2011年(55)

2009年(1)

2008年(2)

分类: LINUX

2011-08-21 17:22:58

(三) view(视图),实现访问控制
    当来自不同ip的主机访问时,我将其解析到不同的地方。比如,来自192.168.0.0/24网段的主机访问,我将其解析到192.168.0.15。来自172.16.0.0/16网段的主机访问,我将其解析到172.16.100.1。

  1. #vim /etc/named.conf
  2. ---------------------
  3. acl internal {
  4. 192.168.0.0/24;
  5. 127.0.0.0/8;
  6. };
  7. acl external {
  8. 172.16.0.0/16;
  9. };
  10. options {
  11. directory "/var/named";
  12. }
  13. view "INNET" {
  14.  match-clients { internal; };
  15.  recursion yes;

  16.  zone "." IN {
  17.   type hint;
  18.   file "named.ca";
  19.  };

  20.  zone "a.org" IN {
  21.   type master;
  22.   file "a.org.internal";
  23.   };

  24. };
  25. view "EXNET" {
  26.  match-clients { external; };
  27.  recursion no;

  28.  zone "." IN {
  29.   type hint;
  30.   file "named.ca";
  31.  };

  32.  zone "a.org" IN {
  33.   type master;
  34.   file "a.org.external";
  35.   };
  36. };
  37. ---------------------------
  38. #vim a.org.internal
  39. ---------------
  40. $TTL 86400
  41. @ IN SOA ns1.a.org. admin.a.org. (
  42.                                                 2011081701
  43.                                                 1H
  44.                                                 10M
  45.                                                 7D
  46.                                                 1D )
  47. @ IN NS ns1.a.org.
  48. @ IN MX 10 mail.a.org.
  49. ns1.a.org. IN A 192.168.0.15
  50. www.a.org. IN A 192.168.0.15
  51. ftp.a.org. IN A 192.168.0.12
  52. --------
  53. #vim a.org.external
  54. --------
  55. $TTL 86400
  56. @ IN SOA ns1.a.org. admin.a.org. (
  57.                                                 2011081701
  58.                                                 1H
  59.                                                 10M
  60.                                                 7D
  61.                                                 1D )
  62. @ IN NS ns1.a.org.
  63. @ IN MX 10 mail.a.org.
  64. ns1.a.org. IN A 172.16.100.1
  65. www.a.org. IN A 172.16.100.1
  66. ftp.a.org. IN A 172.16.100.2
阅读(1396) | 评论(0) | 转发(0) |
0

上一篇:DNS配置(二)

下一篇:iptables的使用

给主人留下些什么吧!~~