Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3285300
  • 博文数量: 815
  • 博客积分: 12898
  • 博客等级: 上将
  • 技术积分: 7883
  • 用 户 组: 普通用户
  • 注册时间: 2006-12-25 09:57
文章分类

全部博文(815)

文章存档

2014年(1)

2011年(46)

2010年(192)

2009年(121)

2008年(70)

2007年(385)

分类: BSD

2007-05-24 19:13:37

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.201

ftp     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    

201     IN      PTR    
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 script
case "$1" in
start)
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 stop
sleep 5
$0 start
;;
*)
echo "$0 start | stop | restart"
;;
esac





阅读(1221) | 评论(0) | 转发(0) |
0

上一篇:OpenBSD网络设置

下一篇:常用命令

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