歡迎您光臨本站 註冊首頁

域名緩存伺服器部署文檔(for linux平台)

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

域名緩存伺服器部署文檔(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.編輯name.conf主配置文件
forwarders { 192.168.2.1;192.168.2.5; } 這裡指的是緩存從伺服器從主輔DNS伺服器上面去查找
[[email protected] ~]#vim /etc/named.conf
options {
forwarders { 192.168.2.1; };


};
確定目錄底下有/var/named/named.ca,named.ca文件
[[email protected] ~]#cat /var/named/named.ca
; <<>> DiG 9.5.0b2 <<>> bufsize=1200 norec NS . @a.root-servers.net
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 34420
;; flags: qr aa; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 20

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;. IN NS

;; ANSWER SECTION:
. 518400 IN NS M.ROOT-SERVERS.NET.
. 518400 IN NS A.ROOT-SERVERS.NET.
. 518400 IN NS B.ROOT-SERVERS.NET.
. 518400 IN NS C.ROOT-SERVERS.NET.
. 518400 IN NS D.ROOT-SERVERS.NET.
. 518400 IN NS E.ROOT-SERVERS.NET.
. 518400 IN NS F.ROOT-SERVERS.NET.
. 518400 IN NS G.ROOT-SERVERS.NET.
. 518400 IN NS H.ROOT-SERVERS.NET.
. 518400 IN NS I.ROOT-SERVERS.NET.
. 518400 IN NS J.ROOT-SERVERS.NET.
. 518400 IN NS K.ROOT-SERVERS.NET.
. 518400 IN NS L.ROOT-SERVERS.NET.

;; ADDITIONAL SECTION:
A.ROOT-SERVERS.NET. 3600000 IN A 198.41.0.4
A.ROOT-SERVERS.NET. 3600000 IN AAAA 2001:503:ba3e::2:30


B.ROOT-SERVERS.NET. 3600000 IN A 192.228.79.201
C.ROOT-SERVERS.NET. 3600000 IN A 192.33.4.12
D.ROOT-SERVERS.NET. 3600000 IN A 128.8.10.90
E.ROOT-SERVERS.NET. 3600000 IN A 192.203.230.10
F.ROOT-SERVERS.NET. 3600000 IN A 192.5.5.241
F.ROOT-SERVERS.NET. 3600000 IN AAAA 2001:500:2f::f
G.ROOT-SERVERS.NET. 3600000 IN A 192.112.36.4
H.ROOT-SERVERS.NET. 3600000 IN A 128.63.2.53
H.ROOT-SERVERS.NET. 3600000 IN AAAA 2001:500:1::803f:235
I.ROOT-SERVERS.NET. 3600000 IN A 192.36.148.17
J.ROOT-SERVERS.NET. 3600000 IN A 192.58.128.30
J.ROOT-SERVERS.NET. 3600000 IN AAAA 2001:503:c27::2:30
K.ROOT-SERVERS.NET. 3600000 IN A 193.0.14.129
K.ROOT-SERVERS.NET. 3600000 IN AAAA 2001:7fd::1
L.ROOT-SERVERS.NET. 3600000 IN A 199.7.83.42
M.ROOT-SERVERS.NET. 3600000 IN A 202.12.27.33
3.確定關閉防火牆或清空防火牆,重啟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
4.測試域名緩存伺服器
一次測試把域名緩存伺服器分別指向主DNS和輔DSN伺服器,再次配置客戶端的DNS地址,這裡客戶的地址是指向域名緩存伺服器的IP(192.168.2.6)
二次測試把域名緩存伺服器指向主,輔DNS,配置客戶的DNS地址(同上為192.168.2.6)
兩次測試都必須要在客戶端使用nslookup命令來解析www.test.com / ftp.test.com / mail.test.com / aa.test.com


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


[火星人 ] 域名緩存伺服器部署文檔(for linux平台)已經有489次圍觀

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