在RH AS 3上完全编译安装BIND-9.2.3
发表于:2007-07-04来源:作者:点击数:
标签:
[code:1:d8aa9110ce] 本人声明: 如需转载请保留下面的信息: author:llzqq mailllzqq@126.com fromwww.china unix .net 安装BIND9: #tarzxvfbind-9.2.3.tar.gz #cdbind-9.2.3 #./configure --prefix=/usr/local/named --disable-ipv6 #make #makeinstall
[code:1:d8aa9110ce]
本人声明:
如需转载请保留下面的信息:
author:llzqq
mail:llzqq@126.com
from:www.china
unix.net安装BIND9:
# tar zxvf bind-9.2.3.tar.gz
# cd bind-9.2.3
# ./configure
--prefix=/usr/local/named
--disable-ipv6
# make
# make install
建立BIND用户:
# groupadd bind
# useradd -g bind -d /usr/local/named -s /sbin/nologin bind
创建配置文件目录:
# mkdir –p /usr/local/named/etc
# chown bind:bind /usr/local/named/etc
# chmod 700 /usr/local/named/etc
创建主要的配置文件:
# vi /usr/local/named/etc/named.conf
===========================named.conf=======================
acl "trust-lan" { 127.0.0.1/8; 192.168.0.0/16;};
options {
directory "/usr/local/named/etc/";
pid-file "/var/run/named/named.pid";
version "0.0.0";
datasize 40M;
allow-transfer {
"trust-lan";};
recursion yes;
allow-notify {
"trust-lan";
};
allow-recursion {
"trust-lan";
};
auth-nxdomain no;
forwarders {
202.99.160.68;
202.99.168.8;};
};
logging {
channel warning
{ file "/var/log/named/dns_warnings" versions 3 size 1240k;
severity warning;
print-category yes;
print-severity yes;
print-time yes;
};
channel general_dns
{ file "/var/log/named/dns_logs" versions 3 size 1240k;
severity info;
print-category yes;
print-severity yes;
print-time yes;
};
category default { warning; };
category queries { general_dns; };
};
zone "." {
type hint;
file "named.root";
};
zone "0.0.127.IN-ADDR.ARPA" {
type master;
file "localhost";
};
zone "home.com" {
type slave;
file "home.com";
masters {
192.168.0.1;
};
};
zone "0.168.192.in-addr.arpa" {
type slave;
file "0.168.192.in-addr";
masters {
192.168.0.1;
};
};
=========================named.conf==========================
# vi /usr/local/named/etc/home.com
============================ home.com ==========================
$TTL 86400
$ORIGIN home.com.
@ IN
SOA redhat.home.com. root.home.com (
2001111601 ; serial
28800 ; refresh
14400 ; retry
3600000 ; expire
86400 ; default_ttl
)
IN NS redhat.home.com.
;; -- default address -
@ IN A 192.168.0.1
;; -- redhat SerVer --
redhat IN A 192.168.0.1
IN MX 0 redhat.home.com.
IN MX 10
linux.home.com
IN HINFO "redhat as 3.0".
IN TXT "The internet gateway".
;; --- WIN2K SerVer ---
win2k IN A 192.168.0.10
IN MX 0 win2k.home.com.
IN MX 10 redhat.home.com.
IN HINFO "
windows 2000 server".
;; ------ cnames ------
dns IN CNAME redhat
www IN CNAME redhat
mail IN CNAME redhat
ftp IN CNAME redhat
============================ home.com ==========================
# vi /usr/local/named/etc/0.168.192.in-addr
======================== 0.168.192.in-addr =====================
$TTL 86400
@ IN SOA redhat.home.com. root.home.home.com. (
2001111601 ; Serial
28800 ; refresh
14400 ; retry
3600000 ; expire
86400 ) ; minimum
@ IN NS redhat.home.com.
1 IN PTR dns.home.com.
1 IN PTR www.home.com.
1 IN PTR mail.home.com.
1 IN PTR ftp.home.com.
10 IN PTR win2k.home.com.
======================== 0.168.192.in-addr ======================
# vi /usr/local/named/etc/localhost
=========================== localhost ===========================
$TTL 3600
@ IN SOA redhat.home.com. root.home.home.com. (
20040526 ; Serial
3600 ; Refresh
900 ; Retry
3600000 ; Expire
3600 ) ; Minimum
IN NS redhat.home.com.
1 IN PTR localhost.home.com.
=========================== localhost ===========================
更新根区文件:
# cd /usr/local/named/etc/
# wget ftp://ftp.internic.org/domain/named.root
创建PID和日志文件:
# mkdir /var/run/named/
# chmod 777 /var/run/named/
# chown bind:bind /var/run/named/
# mkdir /var/log/named/
# touch /var/log/named/dns_warnings
# touch /var/log/named/dns_logs
# chown bind:bind /var/log/named/*
生成rndc-key:
# cd /usr/local/named/etc/
# ../sbin/rndc-confgen > rndc.conf
把rndc.conf中:
# Use with the following in named.conf, adjusting the allow list as needed:
后面以的部分加到/usr/local/named/etc/named.conf中并去掉注释
运行测试:
# /usr/local/named/sbin/named -gc /usr/local/named/etc/named.conf &
状态检查:
# /usr/local/named/sbin/rndc status
建立启动脚本:
# vi /etc/init.d/named
============================== named.sh============================
#!/bin/bash
#
# named a network name service.
#
#
# chkconfig: 545 35 75
# description: a name server
#
if [ `id -u` -ne 0 ]
then
echo "ERROR:For bind to port 53,must run as root."
exit 1
fi
case "$1" in
start)
if [ -x /usr/local/named/sbin/named ]; then
/usr/local/named/sbin/named -u bind -c /usr/local/named/etc/named.conf && echo . && echo 'BIND9 server started.'
fi
;;
stop)
kill `cat /var/run/named/pid` && echo . && echo 'BIND9 server stopped.'
;;
restart)
echo .
echo "Restart BIND9 server"
$0 stop
sleep 10
$0 start
;;
*)
echo "$0 start | stop | restart"
;;
esac
===============================named.sh============================
# chmod 755 /etc/init.d/named
# chown root:root /etc/init.d/named
# chkconfig --add named
# chkconfig named on
[/code:1:d8aa9110ce]
llzqq 回复于:2004-06-04 11:20:13 |
希望大家都把自己的学习成果放到这里来,这样CHINAUNIX才会更有人气啊
|
linux888 回复于:2004-06-04 16:13:14 |
刚从分公司回来,虽然没有看。但是知道一定是好帖。支持你兄弟~
|
llzqq 回复于:2004-06-04 16:35:21 |
[quote:c0d638a705="linux888"]刚从分公司回来,虽然没有看。但是知道一定是好帖。支持你兄弟~[/quote:c0d638a705]
谢谢兄弟支持啊
|
platinum 回复于:2004-06-04 20:32:04 |
好贴!
|
HonestQiao 回复于:2004-06-04 21:20:33 |
不知道本文所谓再发一篇,有什么独特之处,或者有什么更好的见解。
如果没有,那还不如写一篇大纵化的的编译方法过程文档,使得别人看了,可以对一般的进行编译。
|
Greenpower 回复于:2004-06-04 22:11:19 |
BIND是做什么用的? 谢谢, DNS有关的,可以具体些吗?
|
llzqq 回复于:2004-06-05 08:30:58 |
[quote:3422299110="HonestQiao"]不知道本文所谓再发一篇,有什么独特之处,或者有什么更好的见解。
如果没有,那还不如写一篇大纵化的的编译方法过程文档,使得别人看了,可以对一般的进行编译。[/quote:3422299110]
斑竹大人“再发一篇”是指我昨天一气发了四篇(solaris版有三篇)文档而言的,请谅解啊,我已经改了标题了。
|
ports 回复于:2004-06-05 10:16:45 |
[quote:d4e94e2050="HonestQiao"]不知道本文所谓再发一篇,有什么独特之处,或者有什么更好的见解。
如果没有,那还不如写一篇大纵化的的编译方法过程文档,使得别人看了,可以对一般的进行编译。[/quote:d4e94e2050] 一言以蔽之:典型的灌水帖。 请不要误会,我是说我自己,呵呵。
|
pansoncn 回复于:2004-06-11 14:56:06 |
llzqq 好同志,值得我们学习
|
fvane 回复于:2004-10-14 15:48:54 |
/etc/init.d/named文档中的
stop) kill `cat /var/run/named/pid` && echo . && echo 'BIND9 server stopped.'
其中pid应为named.pid (需与named.conf中的pid文档同名)否则输入 /etc/init.d/named stop时会出现找不到文件.
我依上述说的配了一遍,可以解析外部的IP及域名,但不能解析本机,正在查询是什么回事呢
|
异乡独行 回复于:2004-10-14 16:00:01 |
好贴,支持!!!!
|
Lanchou 回复于:2005-04-08 18:17:20 |
./configure 出现如下: checking for ar... no configure: error: ar program not found. Pl
ar 是什么? 怎样配置ar ?
多谢!
|
原文转自:http://www.ltesting.net