Chinaunix首页 | 论坛 | 博客
  • 博客访问: 474134
  • 博文数量: 145
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 1139
  • 用 户 组: 普通用户
  • 注册时间: 2014-01-14 16:47
个人简介

路漫漫其修远兮,吾将上下而求索

文章分类

全部博文(145)

文章存档

2016年(10)

2015年(15)

2014年(120)

我的朋友

分类: 系统运维

2014-01-15 14:57:10

 一、主DNS
1、安装bind,bind-chroot

点击(此处)折叠或打开

  1. yum -y install bind bind-chroot

2、修改DNS主配置文件

点击(此处)折叠或打开

  1. vim /etc/named.conf
  2. options {
  3. listen-on port 53 { any; };
  4. listen-on-v6 port 53 { ::1; };
  5. directory "/var/named";
  6. dump-file "/var/named/data/cache_dump.db";
  7. statistics-file
  8. "/var/named/data/named_stats.txt";
  9. memstatistics-file "/var/named/data/named_mem_stats.txt";
  10. allow-query
  11. { any; };
  12. recursion yes;
  13. dnssec-enable yes;
  14. dnssec-validation yes;
  15. dnssec-lookaside auto;
  16. bindkeys-file "/etc/named.iscdlv.key";
  17. };
  18. logging {
  19. channel default_debug {
  20. file
  21. "data/named.run";
  22. severity dynamic;
  23. };
  24. };
  25. zone "." IN {
  26. type hint;
  27. file "named.ca";
  28. };
  29. include
  30. "/etc/named.rfc1912.zones";
3、修改zone文件/etc/named.rfc1912.zones

点击(此处)折叠或打开

  1. vim /etc/named.rfc1912.zones
  2. zone "google.com" IN {
  3. type master;
  4. file "google.zone";
  5. allow-update { none; };
  6. };
  7. zone "0.168.192.in-addr.arpa" IN {
  8. type master;
  9. file
  10. "named.google";
  11. allow-update { none; };
  12. };

4、新建正向和反向数据库文件

点击(此处)折叠或打开

  1. cp -p /var/named/chroot/var/named/named.localhost
  2. /var/named/chroot/var/named/google.zone
  3. cp -p /var/named/chroot/var/named/named.loopback
  4. /var/named/chroot/var/named/named.google

5、编辑google.zone

点击(此处)折叠或打开

  1. $TTL 1D
  2. @ IN SOA ns.google.com. root (
  3. 2011081201 ; serial
  4. 1D ; refresh
  5. 1H ; retry
  6. 1W ; expire
  7. 3H ) ; minimum
  8. @ NS ns.google.com.
  9. ;usa.google.com IN NS ns.usa.google.com.
  10. ;ns.usa.google.com. IN A 192.168.2.1
  11. ns IN A 192.168.0.101
  12. www IN A 192.168.0.101
  13. ftp IN A
  14. 192.168.0.111
  15. mail IN A 192.168.0.112
6、编辑named.google

点击(此处)折叠或打开

  1. $TTL 1D
  2. @ IN SOA ns.google.com. root (
  3. 2011081201 ; serial
  4. 1D ; refresh
  5. 1H ; retry
  6. 1W ; expire
  7. 3H ) ; minimum
  8. NS ns.google.com.
  9. ns A 192.168.0.101
  10. 101 PTR
  11. ns.google.com.
  12. 101 PTR
  13. 111 PTR ftp.google.com.
  14. 112 PTR mail.google.com.

7、service named restart


8、客户端测试
二、辅助DNS
1、安装bind,bind-chroot

点击(此处)折叠或打开

  1. yum -y install bind bind-chroot
2、修改DNS主配置文件

点击(此处)折叠或打开

  1. vim /etc/named.conf
  2. ptions {
  3. listen-on port 53 { any; };
  4. listen-on-v6 port 53 { ::1; };
  5. directory "/var/named";
  6. dump-file "/var/named/data/cache_dump.db";
  7. statistics-file
  8. "/var/named/data/named_stats.txt";
  9. memstatistics-file "/var/named/data/named_mem_stats.txt";
  10. allow-query
  11. { any; };
  12. recursion yes;
  13. dnssec-enable yes;
  14. dnssec-validation yes;
  15. dnssec-lookaside auto;
  16. bindkeys-file "/etc/named.iscdlv.key";
  17. };
  18. logging {
  19. channel default_debug {
  20. file
  21. "data/named.run";
  22. severity dynamic;
  23. };
  24. };
  25. zone "." IN {
  26. type hint;
  27. file "named.ca";
  28. };
  29. include
  30. "/etc/named.rfc1912.zones";

3、修改zone文件/etc/named.rfc1912.zones

点击(此处)折叠或打开

  1. vim /etc/named.rfc1912.zones
  2. zone "google.com" IN {
  3. type slave;
  4. file
  5. "slaves/google.zone";
  6. masters { 192.168.0.101; };
  7. allow-update { none; };
  8. };
  9. zone "0.168.192.in-addr.arpa" IN {
  10. type slave;
  11. file "slaves/named.google";
  12. masters { 192.168.0.101; };
  13. allow-update { none; };
  14. };


4、service named restart


5、查看/var/named/chroot/var/named/slaves下是否有数据库,也可以查看日志
6、客户端测试



阅读(942) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~