免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1278 | 回复: 0
打印 上一主题 下一主题

OpenBSD BIND [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-05-24 19:13 |只看该作者 |倒序浏览

                                                                                                                                1.规范主机名
# cat /etc/myname
ob.atyu.com
2.指定DNS服务器
# cat /etc/resolv.conf
nameserver 10.0.0.200
3.建立bind的配置文件:
# cat /var/named/etc/named.conf
// $OpenBSD: named-simple.conf,v 1.6 2004/08/16 15:48:28 jakob Exp $
//
// Example file for a simple named configuration, processing both
// recursive and authoritative queries using one cache.
// Update this list to include only the networks for which you want
// to execute recursive queries. The default setting allows all hosts
// on any IPv4 networks for which the system has an interface, and
// the IPv6 localhost address.
//
acl clients {
        localnets;
        ::1;
};
options {
        version "";     // remove this to allow version queries
        listen-on    { any; };
#       listen-on-v6 { any; };
        allow-recursion { clients; };
};
logging {
        category lame-servers { null; };
};
// Standard zones
//
zone "." {
        type hint;
        file "standard/root.hint";
};
zone "atyu.com" {        type master;        file "standard/atyu.com";        allow-transfer { localhost; };};
zone "localhost" {
        type master;
        file "standard/localhost";
        allow-transfer { localhost; };
};
zone "127.in-addr.arpa" {
        type master;
        file "standard/loopback";
        allow-transfer { localhost; };
};
zone "0.0.10.in-addr.arpa" {        type master;        file "standard/0.0.10.in-addr";        allow-transfer { localhost; };};
zone "com" {
        type delegation-only;
};
zone "net" {
        type delegation-only;
};
// Master zones
//
//zone "myzone.net" {
//      type master;
//      file "master/myzone.net";
//};
// Slave zones
//
//zone "otherzone.net" {
//      type slave;
//      file "slave/otherzone.net";
//      masters { 192.0.2.1; [...;] };
//};
4.配置区域文件
4.1正向区域
# cat /var/named/standard/atyu.com
$TTL 6h@       IN      SOA     ob.atyu.com. root.atyu.com. (
                        1       ; serial
                        1h      ; refresh
                        30m     ; retry
                        7d      ; expiration
                        1h )    ; minimum
        IN              NS       ob.atyu.com.
@       IN              A       10.0.0.200
ob      IN              A       10.0.0.200
www     IN              A       10.0.0.200
        IN              A       10.0.0.201ftp     IN              A       10.0.0.200
4.2反向区域
# cat /var/named/standard/0.0.10.in-addr
$TTL 6h@       IN      SOA     ob.atyu.com. root.atyu.com. (
                        1       ; serial
                        1h      ; refresh
                        30m     ; retry
                        7d      ; expiration
                        1h )    ; minimum
@       IN      NS      ob.atyu.com.
200     IN      PTR     www.atyu.com.201     IN      PTR     www.atyu.com.
200     IN      PTR     ftp.atyu.com.
5.启动BIND SERVER
#named
6.停BIND SERVER
#kill `cat /var/run/named.pid`
附件:
# cat /script/bind#!/bin/sh#Bind server scriptcase "$1" instart)if [ -x /usr/sbin/named ];then/usr/sbin/named -u named    && echo Bind Start!fi;;stop)kill `cat /var/run/named.pid`  && echo Bind Stop!!
;;restart)echo Bind Restart$0 stopsleep 5$0 start;;*)echo "$0 start | stop | restart";;esac
               
               
               
               
               
               
               
               
               
               
               
               
               
               
               
               
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/28922/showart_308848.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP