Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1715694
  • 博文数量: 782
  • 博客积分: 2455
  • 博客等级: 大尉
  • 技术积分: 4140
  • 用 户 组: 普通用户
  • 注册时间: 2011-04-06 21:37
个人简介

Linux ,c/c++, web,前端,php,js

文章分类

全部博文(782)

文章存档

2015年(8)

2014年(28)

2013年(110)

2012年(307)

2011年(329)

分类: LINUX

2011-08-10 18:46:32

本文所说方法为yum安装,使用name caching方式。其他方法后续有机会再补完吧

01、首先使用yum方式安装所需的程序包:yum install bind bind-chroot caching-nameserver -y

02、进入bind的目录,并复制控制文件:
cd /var/named/chroot/etc;
cp named.caching-nameserver.conf named.conf

03、编辑named.conf文件:vi named.conf

options { listen-on port 53 { any; }; listen-on-v6 port 53 { ::1; }; directory "/var/named"; dump-file "/var/named/data/cache_dump.db"; statistics-file "/var/named/data/named_stats.txt"; memstatistics-file "/var/named/data/named_mem_stats.txt"; forwarders { 8.8.8.8; 202.106.0.20; }; // Those options should be used carefully because they disable port // randomization // query-source port 53; // query-source-v6 port 53; allow-query { any; }; allow-query-cache { any; }; }; logging { channel default_debug { file "data/named.run"; severity dynamic; }; }; view localhost_resolver { match-clients { any; }; match-destinations { any; }; recursion yes; include "/etc/named.rfc1912.zones"; };

04、编辑vi named.rfc1912.zones
如果是主DNS

zone "abc.com" { type master; file "abc.com.zone"; allow-transfer{192.168.1.2;}; }; zone "33.22.11.in-addr.arpa" { type master; file "11.22.33.rev"; allow-transfer{192.168.1.2;}; };

如果是辅DNS

zone "abc.com" { type slave; file "abc.com.zone"; Masters{192.168.1.1;}; }; zone "33.22.11.in-addr.arpa" { type slave; file "11.22.33.rev"; Masters{192.168.1.1;}; };

05、编辑上面配置文件中提到的abc.com.zone文件
cd /var/named/chroot/var/named
vi abc.com.zone

1 2 3 4 5 6 7 8 9 10 11 $TTL 86400 @ IN SOA localhost. root.localhost. ( 20110312 ; Serial 28800 ; Refresh 14400 ; Retry 3600000 ; Expire 86400 ) ; Minimum $ORIGIN abc.com. IN NS dns.abc.com. dns IN A 192.168.1.1 www IN A 192.168.1.1

06、启动服务:service named start

07、将服务设置为开机自启

1 2 3 4 5 [root@test]chkconfig --list named named 0:off 1:off 2:off 3:off 4:off 5:off 6:off [root@test]chkconfig --level 345 named on [root@test]chkconfig --list named named 0:off 1:off 2:off 3:on 4:on 5:on 6:off

08、至此域名服务器基本搭建完成了~

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