- 论坛徽章:
- 0
|
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 |
|