在RH AS 3上完全編譯安裝BIND-9.2.3(轉)
在RH AS 3上完全編譯安裝BIND-9.2.3(轉)[@more@]安裝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 bind -g bind -d /usr/local/named -s /sbin/nologin建立配置檔案目錄:# 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 ; serial28800 ; refresh14400 ; retry3600000 ; expire86400 ; default_ttl)IN NS redhat.home.com.;; -- default address -@ IN A 192.168.0.1;; -- FreeBSD SerVer --redhat IN A 192.168.0.1IN MX 0 redhat.home.com.IN MX 10 linux.home.comIN HINFO "redhat as 3.0".IN TXT "The internet gateway".;; --- WIN2K SerVer ---win2k IN A 192.168.0.10IN MX 0 win2k.home.com.IN MX 10 redhat.home.com.IN HINFO "windows 2000 server".;; ------ cnames ------dns IN CNAME redhatwww IN CNAME redhatmail IN CNAME redhatftp 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 ; Serial28800 ; refresh14400 ; retry3600000 ; expire86400 ) ; minimum@ IN NS redhat.home.com.1 IN PTR dns.home.com.1 IN PTR 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 ; Serial3600 ; Refresh900 ; Retry3600000 ; Expire3600 ) ; MinimumIN 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 ]thenecho "ERROR:For bind to port 53,must run as root."exit 1ficase "$1" instart)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 stopsleep 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 o
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8225414/viewspace-945026/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【轉】MySQL原始碼編譯安裝MySql原始碼編譯
- 在VMware已安裝的CentOS7.9上編譯安裝mysql5.6CentOS編譯MySql
- 在Ubuntu 18.04上編譯安裝pppoe客戶端軟體Ubuntu編譯客戶端
- 在麒麟V10伺服器上編譯安裝HAProxy伺服器編譯
- orthanc 編譯安裝mysql S3編譯MySqlS3
- [轉]如何完全解除安裝WSL
- centos7編譯安裝python3CentOS編譯Python
- CentOS下編譯安裝Python3教程CentOS編譯Python
- MAC M3 編譯安裝mysql 5.7.44Mac編譯MySql
- CentOS 7下編譯安裝Python3CentOS編譯Python
- 編譯安裝zabbix編譯
- 安裝編譯ffmpeg編譯
- Griffin編譯安裝編譯
- 編譯安裝nmon編譯
- swoole 編譯安裝編譯
- apache編譯安裝Apache編譯
- ffmpeg安裝之linux編譯安裝Linux編譯
- httpd編譯安裝phphttpd編譯PHP
- Shell編譯安裝nginx編譯Nginx
- Linux 編譯安裝 PythonLinux編譯Python
- Linux編譯安裝NginxLinux編譯Nginx
- centos PHP 編譯安裝CentOSPHP編譯
- 樹莓派編譯安裝opencv3 (2019.1.6更新)樹莓派編譯OpenCV
- 編譯安裝baas平臺-cello-h3c編譯
- python3安裝編譯_tkinter模組丟失Python編譯
- 雲端計算 | 在ARM64系統上編譯安裝Gitlab Docker映象編譯GitlabDocker
- 在CentOS 7上編譯QtumCentOS編譯QT
- CentOS 8上安裝GCC實現開發編譯功能CentOSGC編譯
- PHP Linux安裝擴充套件(編譯安裝)PHPLinux套件編譯
- 【MySQL安裝】Linux下安裝MySQL(預編譯)MySqlLinux編譯
- 反編譯之安裝Apktool編譯APK
- Xopsed的編譯與安裝編譯
- Linux 編譯 安裝 PHP 7.3.1Linux編譯PHP
- windows下編譯安裝thriftWindows編譯
- ubuntu編譯安裝pcl教程。Ubuntu編譯
- ubuntu編譯安裝kernel教程。Ubuntu編譯
- PHP7 編譯安裝PHP編譯
- CentOS 下編譯安裝 NginxCentOS編譯Nginx
- CentOS 下編譯安裝 apacheCentOS編譯Apache