歡迎您光臨本站 註冊首頁

輔DNS伺服器部署文檔(for linux平台)

←手機掃碼閱讀     火星人 @ 2014-03-09 , reply:0

輔助DNS伺服器部署文檔(for linux平台)
一.配置yum,以便安裝軟體包
yum全局文件編輯目錄: /etc/yum.repos.d/rhel-source.repo
[[email protected] ~]# vim //etc/yum.repos.d/rhel-source.repo
#[rhel-source]
#name=Red Hat Enterprise Linux $releasever - $basearch - Source
#baseurl=ftp://ftp.redhat.com/pub/redhat/linux/enterprise/$releasever/en/os/SRPMS/
#enabled=0
#gpgcheck=1
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

#[rhel-source-beta]
#name=Red Hat Enterprise Linux $releasever Beta - $basearch - Source
#baseurl=ftp://ftp.redhat.com/pub/redhat/linux/beta/$releasever/en/os/SRPMS/
#enabled=0
#gpgcheck=1
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[wanghong]
Name=123
Baseurl=file:///mnt/Server
enable=1
gpgcheck=0
備註: #是註釋作用,在此對文件沒用任何影響,可以去掉
二.安裝DNS服務軟體包
1.DNS服務軟體包名如下:
bind-9.3.3-7.el5.i386.rpm
bind-chroot-9.3.3-7.el5.i386.rpm
[[email protected] ~]# mount /dev/cdrom /mnt
[[email protected] ~]# yum install bind bind-chroot
執行此過程,就可以正常的安裝DNS服務包軟體,或者用以下命令也可以正常安裝DNS服務包軟體
[[email protected] ~]# mount /dev/cdrom /mnt
[[email protected] ~]# rpm -ivh bind-9.3.3-7.el5.i386.rpm --force
[[email protected] ~]# rpm -ivh bind-chroot-9.3.3-7.el5.i386.rpm --force
--foce 代表強制安裝

2.編輯全局配置文件named.conf
如果目錄/etc或/var/named/chroot/var/etc/named.conf沒有named.conf文件,需要在目錄底下創建named.conf文件(目錄/var/named/chr oot/etc/)


[[email protected] ~]# touch /var/named/chroot/etc/named.conf
[[email protected] ~]# vim /var/named/chroot/etc/named.conf

options {
directory "/var/named";
};

zone "test.com" IN {
type slave;
masters { 192.168.2.1; };
file "slaves/tets.com.zone";
};


zone "2.168.192.in-addr.arpa" IN {
type slave;
masters { 192.168.2.1; };
file "slaves/192.168.2.arpa";
};
3.編輯配置文件named.rfc1912.zones
如果目錄/etc或/var/named/chroot/var/etc/named.rfc1912.zones沒有named.rfc1912.zones文件,需要在目錄底下創建named.rfc1912.zones文件(目錄/var/named/chroot/etc/)
[[email protected] ~]# touch /var/named/chroot/etc/named.rfc1912.zones
[[email protected] ~]# vim /var/named/chroot/etc/named.rfc1912.zones
type master;
file "named.localhost";
allow-update { none; };
};

zone "localhost" IN {
type master;
file "named.localhost";
allow-update { none; };
};

zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN {
type master;
file "named.loopback";
allow-update { none; };
};

zone "1.0.0.127.in-addr.arpa" IN {
type master;
file "named.loopback";


allow-update { none; };
};

zone "0.in-addr.arpa" IN {
type master;
file "named.empty";
allow-update { none; };
};

zone "test.com" IN {
type slave;
masters { 192.168.2.1; };
file "slaves/tets.com.zone";
};


zone "2.168.192.in-addr.arpa" IN {
type slave;
masters { 192.168.2.1; };
file "slaves/192.168.2.arpa";
};
4.確定關閉防火牆或清空防火牆,重啟named服務
關閉防火牆服務
[[email protected] ~]# service iptables stop
[[email protected] ~]# chkconfig iptables off
或者執行清空防火牆命令
[[email protected] ~]# iptables -F
[[email protected] ~]# service iptables save
開起named服務
[[email protected] ~]# service named start
[[email protected] ~]# chkconfig named on

三.測試輔助DNS服務
1.配置客戶端DNS地址192.168.2.*(這裡地址為輔助DNS服務地址192.168.2.5)
使用nslookup命令,解析www.test.com /ftp.test.com/mail.test.com /aa.test.com
2.給客戶端配置主DNS和輔DNS192.168.2.*(這裡主DNS地址為192.168.2.1,輔DNS地址為192.168.2.5), 再用nslookup命令,解析www.test.com /ftp.test.com / mail.test.com / aa.test.com

本文出自 「學海無涯苦作舟!」 博客,謝絕轉載!


[火星人 ] 輔DNS伺服器部署文檔(for linux平台)已經有474次圍觀

http://coctec.com/docs/linux/show-post-47627.html