學校TANet無線網路認證時若發現機器有訊號但連不上機器:
1.拔電源,重開機看看,排除當機故障。
2.檢查Juniper防火牆設定看看無線網路ip有沒有release,應設定定時release!
2015年7月28日 星期二
伺服器網頁編碼不同時
目前的網際網路傳輸資料編碼多是以萬國碼 (UTF-8) 為主,不過在台灣還是有相當多的網站使用的是 Big5 的繁體中文編碼啊!如果你的 Apache 預設是以 UTF-8 編碼來傳輸資料,但你 WWW 的資料卻是 big5 , 那麼用戶端將會看到『亂碼』!雖然可以透過調整瀏覽器的編碼來讓資料正確顯示,不過總是覺得很討厭。 此時,你應該可以調整一下底下的參數喔!
[root@www ~]# vim /etc/httpd/conf/httpd.conf # 找到底下這一行,應該是在 747 行左右 # AddDefaultCharset UTF-8 <==請將她註解掉!資料來源:鳥哥的私房菜
2015年5月21日 星期四
2015年2月14日 星期六
2015年2月5日 星期四
網頁中嵌入GOOGLE所有相簿連播
這功能對我來說頗重要
所以今晚稍微玩了一下 有點小心得
都是一步一腳印用笨方法試出來的
也不確定是否完全無誤
若是有錯 還請指正
以免誤導他人
感謝先!mOm
所以今晚稍微玩了一下 有點小心得
都是一步一腳印用笨方法試出來的
也不確定是否完全無誤
若是有錯 還請指正
以免誤導他人
感謝先!mOm
首先來看一下原始的語法範例:
<embed type="application/x-shockwave-flash" src="http://picasaweb.google.com/s/c/bin/slideshow.swf"width="400" height="267" flashvars="host=picasaweb.google.com&captions=1&noautoplay=1&RGB=0x000000&feed=http%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2F使用者帳號%2Falbumid%2F###################%3Fkind%3Dphoto%26alt%3Drss" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>
很花對不對?
來來來... 湯姆最愛幫人家畫重點了
我們一起看下去
來來來... 湯姆最愛幫人家畫重點了
我們一起看下去
重點一:width和height
這很簡單
就是設定播放視窗的寬度值與高度值
這很簡單
就是設定播放視窗的寬度值與高度值
重點二:captions=1
這參數用來設定slideshow中要不要同時顯示各張圖片的文字說明
如果不要的話
那就把"&captions=1"這段語法刪掉
這參數用來設定slideshow中要不要同時顯示各張圖片的文字說明
如果不要的話
那就把"&captions=1"這段語法刪掉
重點三:noautoplay=1
這參數用來設定要不要自動播放
如果要的話
那就把"&noautoplay=1"這段語法刪掉
這參數用來設定要不要自動播放
如果要的話
那就把"&noautoplay=1"這段語法刪掉
好!
了解這四個重點之後
我們應該已經可以很靈活地將Picasa相簿的slideshow運用在自己的網誌中了
比如設定視窗大小啦
改變底色來搭配網頁用色啦
或者...什麼?
要如何置中是嗎?
在這段語法前後用<center>和</center>包起來就可以了
了解這四個重點之後
我們應該已經可以很靈活地將Picasa相簿的slideshow運用在自己的網誌中了
比如設定視窗大小啦
改變底色來搭配網頁用色啦
或者...什麼?
要如何置中是嗎?
在這段語法前後用<center>和</center>包起來就可以了
玩到這裡
不知道有沒有人跟湯姆一樣產生某種聯想─
那如果想在網頁邊欄播放個人所有相簿中的圖片
是不是也可以從這段語法中去修改呢?
不知道有沒有人跟湯姆一樣產生某種聯想─
那如果想在網頁邊欄播放個人所有相簿中的圖片
是不是也可以從這段語法中去修改呢?
當然
要是改不出來 還是可以土法煉鋼─
新增一本相簿 把所有圖片都複製進去
然後再播放這本新相簿就好了
要是改不出來 還是可以土法煉鋼─
新增一本相簿 把所有圖片都複製進去
然後再播放這本新相簿就好了
可是 這樣一來會加倍消耗相簿的可用容量(?)
所以我又摸索了一下
結果還真試出了方法:
所以我又摸索了一下
結果還真試出了方法:
<embed type="application/x-shockwave-flash" src="http://picasaweb.google.com/s/c/bin/slideshow.swf"width="100%" height="130" flashvars="host=picasaweb.google.com&captions=1&RGB=0x000000&feed=http%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2F使用者帳號%3Fkind%3Dalbum%26alt%3Drss" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>
如此一來
便可以在邊欄中自動播放所有相簿封面的slideshow
並且同時顯示各相簿的文字敘述(description)
便可以在邊欄中自動播放所有相簿封面的slideshow
並且同時顯示各相簿的文字敘述(description)
此外 若想播放全部相簿中的所有照片
那請將上述語法中紅色標示的album改成photo就可以了
那請將上述語法中紅色標示的album改成photo就可以了
不過 個人覺得
就視覺感受來說
較諸Flickr提供的Daily Zeitgeist
這樣的邊欄slideshow不免顯得過於陽春
還是期待來日會有官方版本釋出
資料來源:http://roxytom.bluecircus.net/archives/009894.html
就視覺感受來說
較諸Flickr提供的Daily Zeitgeist
這樣的邊欄slideshow不免顯得過於陽春
還是期待來日會有官方版本釋出
資料來源:http://roxytom.bluecircus.net/archives/009894.html
2015年2月4日 星期三
網頁彈跳視窗廣告製作
v:shape id="_x0000_i1025" type="#_x0000_t75" style='width:600pt;
height:422pt' =>修改圖片大小
<script language="JavaScript">window.open("..........","popup","width=852,height=600, =>修改彈跳視窗大小
<!-- ... 這裡是註解文字 ... --> =>網頁註解用語法
height:422pt' =>修改圖片大小
<script language="JavaScript">window.open("..........","popup","width=852,height=600, =>修改彈跳視窗大小
<!-- ... 這裡是註解文字 ... --> =>網頁註解用語法
2014年9月8日 星期一
2014年8月16日 星期六
RedHat/Fedora/CentOs Linux 中啟動及設定IPv6
| ||||||||
資料來源:http://note.tc.edu.tw/462.html
IPV6設定
CentOS IP設定
若只有一張網路卡,則網路設定檔位於
/etc/sysconfig/netwotk-scripts/ifcfg-eth0
通常系統安裝完成預設為DHCP模式,以下為設定檔內容範例:
DEVICE="eth0"//網路卡代號
BOOTPROTO="dhcp" //若為固定IP則為BOOTPROTO="none"
HWADDR="00:0C:29:73:E4:76"
IPV6INIT="yes"//是否使用ipv6
NM_CONTROLLED="yes" //網管軟體相關
ONBOOT="yes" //安裝完成網路預設為不啟動,ONBOOT="no",用以避免駭客入侵
TYPE="Ethernet"
UUID="b5f711d7-743a-44ae-baae-10dffe1f1d5e"
BOOTPROTO="dhcp" //若為固定IP則為BOOTPROTO="none"
HWADDR="00:0C:29:73:E4:76"
IPV6INIT="yes"//是否使用ipv6
NM_CONTROLLED="yes" //網管軟體相關
ONBOOT="yes" //安裝完成網路預設為不啟動,ONBOOT="no",用以避免駭客入侵
TYPE="Ethernet"
UUID="b5f711d7-743a-44ae-baae-10dffe1f1d5e"
備註:指令啟用/關閉網路卡
啟用:ifup 網路卡代號 或
ifup 網路卡代號 up
關閉:ifup 網路卡代號 down
若須設定固定IP,假設條件如下:
IP:192.168.2.168
網路遮罩:255.255.255.0
預設閘道:192.168.2.1
DNS伺服器:168.95.1.1
8.8.8.8
則檔案修改如下:
DEVICE="eth0"
BOOTPROTO="none"
HWADDR="00:0C:29:73:E4:76"
IPV6INIT="yes"
NM_CONTROLLED="yes"
ONBOOT="yes"
TYPE="Ethernet"
UUID="b5f711d7-743a-44ae-baae-10dffe1f1d5e"
IPADDR=192.168.2.168
NETMASK=255.255.255.0
GATEWAY=192.168.2.1
DNS1=168.95.1.1
DNS2=8.8.8.8
BOOTPROTO="none"
HWADDR="00:0C:29:73:E4:76"
IPV6INIT="yes"
NM_CONTROLLED="yes"
ONBOOT="yes"
TYPE="Ethernet"
UUID="b5f711d7-743a-44ae-baae-10dffe1f1d5e"
IPADDR=192.168.2.168
NETMASK=255.255.255.0
GATEWAY=192.168.2.1
DNS1=168.95.1.1
DNS2=8.8.8.8
修改存檔後重新啟動網路設定
service network restart
或
/etc/init.d/network restart
資料來源:http://kirby86a.pixnet.net/blog/post/98811821-centos-6.4%E5%BF%AB%E9%80%9F%E8%A8%AD%E5%AE%9A%E5%9B%BA%E5%AE%9Aip
資料來源:http://kirby86a.pixnet.net/blog/post/98811821-centos-6.4%E5%BF%AB%E9%80%9F%E8%A8%AD%E5%AE%9A%E5%9B%BA%E5%AE%9Aip
CentOS DNS安裝設定參考
在CentOS5系統中,IPv6 DNS Server的修正與設定,算是複雜度比較高的項目之一。以下的文件整理,僅針對已建立完成的DNS Server作修正,因為DNS Server本身的複雜度就很高,若參考完本整理文件,也許會抓不著頭緒,敬請參考這幾年的研習講義,再來看這篇整理文件,也許就會瞭解比較多一點!
注意:這個文件僅僅是修正的整理筆記,您將無法獲得完整的操作資訊!
照例,我還是喜歡用快速檢測法來看看,我們家的DNS Server到底有沒有開啟IPv6的功能。
# netstat -an | grep :53
tcp 0 0 163.32.225.1:53 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN
udp 0 0 163.32.225.1:53 0.0.0.0:*
udp 0 0 127.0.0.1:53 0.0.0.0:*
tcp 0 0 163.32.225.1:53 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN
udp 0 0 163.32.225.1:53 0.0.0.0:*
udp 0 0 127.0.0.1:53 0.0.0.0:*
看到這四行連線的狀態,就知道果然是還沒有開啟IPv6的功能。
首先,我們要先確認一下,目前bind的版本是否支援IPv6功能,若不支援,就要昇級版本了!
# rpm -qa | grep bind
ypbind-1.19-12.el5
bind-libs-9.3.6-4.P1.el5_4.2
bind-9.3.6-4.P1.el5_4.2
bind-utils-9.3.6-4.P1.el5_4.2
bind-chroot-9.3.6-4.P1.el5_4.2
ypbind-1.19-12.el5
bind-libs-9.3.6-4.P1.el5_4.2
bind-9.3.6-4.P1.el5_4.2
bind-utils-9.3.6-4.P1.el5_4.2
bind-chroot-9.3.6-4.P1.el5_4.2
版本號碼是 9.3.6,還好是支援IPv6的。
(補充說明:bind是在4.9.5 及 8.1 版以後,就支援IPv6的AAAA記錄;9版以後,更支援一些進階的設定方式。)
(補充說明:bind是在4.9.5 及 8.1 版以後,就支援IPv6的AAAA記錄;9版以後,更支援一些進階的設定方式。)
在修改設定檔之前,要先將這台主機設定成IPv4/IPv6的的網路環境,並使用固定IPv6位址,完成後,再來修定named的設定檔。
第二個重點,要先蒐集並確認下列幾項IP資料:
DNS IPv6 IP ==>2001:288:82xx:1::1/64
校內網段==> 2001:288:82xx:1::/64 , 2001:288:82xx:5::/64 , 2001:288:82xx:6::/64
上層DNS IP ==> 163.28.136.14 , 2001:288:8201:1::14 , 163.28.136.2 , 2001:288:8201:1::2 , 163.28.136.10 , 2001:288:8201:1::10
DNS IPv6 IP ==>2001:288:82xx:1::1/64
校內網段==> 2001:288:82xx:1::/64 , 2001:288:82xx:5::/64 , 2001:288:82xx:6::/64
上層DNS IP ==> 163.28.136.14 , 2001:288:8201:1::14 , 163.28.136.2 , 2001:288:8201:1::2 , 163.28.136.10 , 2001:288:8201:1::10
接下來我們就依照設定檔的順序,一一地來修改DNS的設定檔,讓DNS Server可以支援IPv6功能。
1.named.conf的修定:設定檔在 /var/named/chroot/etc/named.conf
1-1.ACL描述部份:
1-1-1.acl secondaries 描述中,新增三筆上層DNS主機的IPv6位址。
acl secondaries {
localhost;
163.28.136.14/32;
163.28.136.10/32;
163.28.136.2/32;
2001:288:8201:1::14/128;
2001:288:8201:1::2/128;
2001:288:8201:1::10/128;
};
1-1-2.trusted 描述中,新增校內所有IPv6網段。
localhost;
163.28.136.14/32;
163.28.136.10/32;
163.28.136.2/32;
2001:288:8201:1::14/128;
2001:288:8201:1::2/128;
2001:288:8201:1::10/128;
};
1-1-2.trusted 描述中,新增校內所有IPv6網段。
acl trusted {
localnets;
163.32.225.0/24;
192.168.100.0/24;
192.168.101.0/24;
2001:288:82xx:1::/64;
2001:288:82xx:5::/64;
2001:288:82xx:6::/64;
};
localnets;
163.32.225.0/24;
192.168.100.0/24;
192.168.101.0/24;
2001:288:82xx:1::/64;
2001:288:82xx:5::/64;
2001:288:82xx:6::/64;
};
1-2.option描述中,新增IPv6的功能:在 allow-transfer 描述之前,新增下列兩行,以同時開啟IPv4/IPv6 DNS功能。
listen-on {any; };
listen-on-v6 {any; };
listen-on-v6 {any; };
2.新增IPv6反解表(zone)設定:為求完整的IPv6正反解環境,必須在設定檔裡新增學校IPv6網段的反解表設定。
這個設定檔的位置,因各校設定方式而異;在named.conf中有設定view描述的,可能會用include方式引入類似named.zone.xx的zone設定檔,或沒設view描述的,就直接放在named.conf檔中。)
(檔案位置:/var/named/chroot/etc/named.conf 或 /var/named/chroot/etc/named.zone.xx)
這個設定檔的位置,因各校設定方式而異;在named.conf中有設定view描述的,可能會用include方式引入類似named.zone.xx的zone設定檔,或沒設view描述的,就直接放在named.conf檔中。)
(檔案位置:/var/named/chroot/etc/named.conf 或 /var/named/chroot/etc/named.zone.xx)
zone “[domain].kh.edu.tw"{
type master;
file “master/named.[domain].in";
};
zone “???.32.163.in-addr.arpa"{
type master;
file “master/named.???.arpa.in";
};
zone “???.168.192.in-addr.arpa"{
type master;
file “master/named.nat???.arpa";
};
zone “???.168.192.in-addr.arpa"{
type master;
file “master/named.nat???.arpa";
};
zone “x.x.2.8.8.8.2.0.1.0.0.2.ip6.arpa" {
type master;
file “master/named.xxxxip6.arpa";
};
type master;
file “master/named.[domain].in";
};
zone “???.32.163.in-addr.arpa"{
type master;
file “master/named.???.arpa.in";
};
zone “???.168.192.in-addr.arpa"{
type master;
file “master/named.nat???.arpa";
};
zone “???.168.192.in-addr.arpa"{
type master;
file “master/named.nat???.arpa";
};
zone “x.x.2.8.8.8.2.0.1.0.0.2.ip6.arpa" {
type master;
file “master/named.xxxxip6.arpa";
};
3.在原有正解表中,加入IPv6的AAAA紀錄。
(檔案位置:/var/named/chroot/var/named/master/named.[domain].xx)
(檔案位置:/var/named/chroot/var/named/master/named.[domain].xx)
$TTL 86400
@ IN SOA [domain].kh.edu.tw. root. [domain].kh.edu.tw. (
2001101201 ; serial
1H ; refresh
15 ; retry
14D ; expire
12H ; Minimum
)
@ IN SOA [domain].kh.edu.tw. root. [domain].kh.edu.tw. (
2001101201 ; serial
1H ; refresh
15 ; retry
14D ; expire
12H ; Minimum
)
@ IN MX 5 mail.[domain].kh.edu.tw.
@ IN NS [domain].kh.edu.tw.
@ IN NS dns.[domain].kh.edu.tw.
@ IN A 163.32.???.1
@ IN AAAA 2001:288:82xx:1::1
dns IN CNAME [domain].kh.edu.tw.
dns.ipv6 IN AAAA 2001:288:82xx:1::1
proxy IN A 192.168.???.2
mail IN A 163.32.???.3
IN AAAA 2001:288:82xx:1::4
IN MX 0 mail.[domain].kh.edu.tw.
www IN A 163.32.???.4
IN AAAA 2001:288:82xx:1::6
www.ipv6 IN AAAA 2001:288:82xx:1::6
ftp IN CNAME www
vlmcs._tcp IN SRV 0 0 1688 ap24.kh.edu.tw.
@ IN NS [domain].kh.edu.tw.
@ IN NS dns.[domain].kh.edu.tw.
@ IN A 163.32.???.1
@ IN AAAA 2001:288:82xx:1::1
dns IN CNAME [domain].kh.edu.tw.
dns.ipv6 IN AAAA 2001:288:82xx:1::1
proxy IN A 192.168.???.2
mail IN A 163.32.???.3
IN AAAA 2001:288:82xx:1::4
IN MX 0 mail.[domain].kh.edu.tw.
www IN A 163.32.???.4
IN AAAA 2001:288:82xx:1::6
www.ipv6 IN AAAA 2001:288:82xx:1::6
ftp IN CNAME www
vlmcs._tcp IN SRV 0 0 1688 ap24.kh.edu.tw.
4.新增一個IPv6反解表檔案:
(檔案位置:/var/named/chroot/var/named/master/named.xxxxip6.arpa)
(檔案位置:/var/named/chroot/var/named/master/named.xxxxip6.arpa)
; IPv6 reverse lookup zone for 2001:288:82xx::/48
@ IN SOA dns.[domain].kh.edu.tw. root.dns.[domain].kh.edu.tw. (
2010042101 ; serial
28800 ; refresh
7200 ; retry
129600 ; expire
86400 ; default_ttl
)
@ IN NS dns.[domain].kh.edu.tw.
; for 2001:288:82xx::/48
$ORIGIN x.x.2.8.8.8.2.0.1.0.0.2.ip6.arpa.
0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0 IN PTR [domain].kh.edu.tw.
; for 2001:288:82xx:1::/64
$ORIGIN 0.0.0.0.0.0.0.0.0.0.0.0.1.0.0.0.x.x.2.8.8.8.2.0.1.0.0.2.ip6.arpa.
1.0.0.0 IN PTR dns.[domain].kh.edu.tw.
4.0.0.0 IN PTR mail.[domain].kh.edu.tw.
; for 2001:288:82xx:5::/64
$ORIGIN 0.0.0.0.0.0.0.0.0.0.0.0.5.0.0.0.x.x.2.8.8.8.2.0.1.0.0.2.ip6.arpa.
6.0.0.0 IN PTR blog.[domain].kh.edu.tw.
7.0.0.0 IN PTR student.[domain].kh.edu.tw.
1.5.0.0 IN PTR sql.[domain].kh.edu.tw.
@ IN SOA dns.[domain].kh.edu.tw. root.dns.[domain].kh.edu.tw. (
2010042101 ; serial
28800 ; refresh
7200 ; retry
129600 ; expire
86400 ; default_ttl
)
@ IN NS dns.[domain].kh.edu.tw.
; for 2001:288:82xx::/48
$ORIGIN x.x.2.8.8.8.2.0.1.0.0.2.ip6.arpa.
0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0 IN PTR [domain].kh.edu.tw.
; for 2001:288:82xx:1::/64
$ORIGIN 0.0.0.0.0.0.0.0.0.0.0.0.1.0.0.0.x.x.2.8.8.8.2.0.1.0.0.2.ip6.arpa.
1.0.0.0 IN PTR dns.[domain].kh.edu.tw.
4.0.0.0 IN PTR mail.[domain].kh.edu.tw.
; for 2001:288:82xx:5::/64
$ORIGIN 0.0.0.0.0.0.0.0.0.0.0.0.5.0.0.0.x.x.2.8.8.8.2.0.1.0.0.2.ip6.arpa.
6.0.0.0 IN PTR blog.[domain].kh.edu.tw.
7.0.0.0 IN PTR student.[domain].kh.edu.tw.
1.5.0.0 IN PTR sql.[domain].kh.edu.tw.
5.重新下載named.cache檔案:下載DNS 13個Root的主機紀錄檔,以更新原有IPv4/IPv6正反解主機狀態。
# cd /var/named/chroot/var/named/master/
# wget ftp://ftp.rs.internic.net/domain/named.cache
# cp -f named.cache root.cache
# wget ftp://ftp.rs.internic.net/domain/named.cache
# cp -f named.cache root.cache
6.重新啟動DNS Service:
# service named restart
7.記得檢查IPv6的防火牆設定,tcp/udp 53 port若沒有開,請重新設定防火牆,並重新啟動。
# service ip6tables status
表格: filter
Chain INPUT (policy ACCEPT)
num target prot opt source destination
1 RH-Firewall-1-INPUT all ::/0 ::/0
表格: filter
Chain INPUT (policy ACCEPT)
num target prot opt source destination
1 RH-Firewall-1-INPUT all ::/0 ::/0
Chain FORWARD (policy ACCEPT)
num target prot opt source destination
1 RH-Firewall-1-INPUT all ::/0 ::/0
num target prot opt source destination
1 RH-Firewall-1-INPUT all ::/0 ::/0
Chain OUTPUT (policy ACCEPT)
num target prot opt source destination
num target prot opt source destination
Chain RH-Firewall-1-INPUT (2 references)
num target prot opt source destination
1 ACCEPT all ::/0 ::/0
2 ACCEPT icmpv6 ::/0 ::/0
3 ACCEPT esp ::/0 ::/0
4 ACCEPT ah ::/0 ::/0
5 ACCEPT udp ::/0 ff02::fb/128 udp dpt:5353
6 ACCEPT udp ::/0 ::/0 udp dpt:631
7 ACCEPT tcp ::/0 ::/0 tcp dpt:631
8 ACCEPT udp ::/0 ::/0 udp dpts:32768:61000
9 ACCEPT tcp ::/0 ::/0 tcp dpts:32768:61000 flags:!0×16/0×02
10 ACCEPT tcp ::/0 ::/0 tcp dpt:53
11 ACCEPT udp ::/0 ::/0 udp dpt:53
12 ACCEPT tcp ::/0 ::/0 tcp dpt:22
13 REJECT all ::/0 ::/0 reject-with icmp6-adm-prohibited
num target prot opt source destination
1 ACCEPT all ::/0 ::/0
2 ACCEPT icmpv6 ::/0 ::/0
3 ACCEPT esp ::/0 ::/0
4 ACCEPT ah ::/0 ::/0
5 ACCEPT udp ::/0 ff02::fb/128 udp dpt:5353
6 ACCEPT udp ::/0 ::/0 udp dpt:631
7 ACCEPT tcp ::/0 ::/0 tcp dpt:631
8 ACCEPT udp ::/0 ::/0 udp dpts:32768:61000
9 ACCEPT tcp ::/0 ::/0 tcp dpts:32768:61000 flags:!0×16/0×02
10 ACCEPT tcp ::/0 ::/0 tcp dpt:53
11 ACCEPT udp ::/0 ::/0 udp dpt:53
12 ACCEPT tcp ::/0 ::/0 tcp dpt:22
13 REJECT all ::/0 ::/0 reject-with icmp6-adm-prohibited
8.再用快速檢查法,查看一下DNS Service是否開啟IPv6功能:
# netstat -an | grep :53
tcp 0 0 163.32.225.1:53 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN
tcp 0 0 :::53 :::* LISTEN
udp 0 0 163.32.225.1:53 0.0.0.0:*
udp 0 0 127.0.0.1:53 0.0.0.0:*
udp 0 0 :::53 :::*
tcp 0 0 163.32.225.1:53 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN
tcp 0 0 :::53 :::* LISTEN
udp 0 0 163.32.225.1:53 0.0.0.0:*
udp 0 0 127.0.0.1:53 0.0.0.0:*
udp 0 0 :::53 :::*
當您看到有 :::53 的狀態,就表示您的DNS Service已經支援IPv6功能了!
資料來源:http://blog.hmes.kh.edu.tw/wordpress/jang/2010/04/22/ipv6-dns-server%E4%BF%AE%E6%AD%A3%E8%88%87%E8%A8%AD%E5%AE%9A/
資料來源:http://blog.hmes.kh.edu.tw/wordpress/jang/2010/04/22/ipv6-dns-server%E4%BF%AE%E6%AD%A3%E8%88%87%E8%A8%AD%E5%AE%9A/
DNS反解設定
| |||||||||||
CentOS6 DNS 安裝
[A] Primary(Master) DNS Server Details:
Operating System : CentOS 6.5 32 bit (Minimal Server)
Hostname : masterdns.ostechnix.com
IP Address : 192.168.1.200/24
[B] Secondary(Slave) DNS Server Details:
Operating System : CentOS 6.5 32 bit (Minimal Server)
Hostname : slavedns.ostechnix.com
IP Address : 192.168.1.201/24
Setup Primary(Master) DNS Server
[root@masterdns ~]# yum install bind* -y
1. Configure DNS Server
The main configuration of the DNS will look like below. Edit and add the entries below which were marked as bold in this configuration files.
[root@masterdns ~]# vi /etc/named.conf
//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
options {
listen-on port 53 { 127.0.0.1; 192.168.1.200;}; ## Master DNS IP ##
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query { localhost; 192.168.1.0/24; }; ## IP Range ##
allow-transfer{ localhost; 192.168.1.201; }; ## Slave DNS IP ##
recursion yes;
dnssec-enable yes;
dnssec-validation yes;
dnssec-lookaside auto;
/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";
managed-keys-directory "/var/named/dynamic";
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "." IN {
type hint;
file "named.ca";
};
zone"ostechnix.com" IN {
type master;
file "fwd.ostechnix.com";
allow-update { none; };
};
zone"1.168.192.in-addr.arpa" IN {
type master;
file "rev.ostechnix.com";
allow-update { none; };
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
2. Create Zone files
Now we should create forward and reverse zone files which we mentioned in the‘/etc/named.conf’ file.
[A] Create Forward Zone
Create ‘fwd.ostechnix.com’ file in the ‘/var/named’ directory and add the entries for forward zone as shown below.
[root@masterdns ~]# vi /var/named/fwd.ostechnix.com
$TTL 86400
@ IN SOA masterdns.ostechnix.com. root.ostechnix.com. (
2011071001 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL
)
@IN NS masterdns.ostechnix.com.
@IN NS slavedns.ostechnix.com.masterdns IN A 192.168.1.200
slavedns IN A 192.168.1.201
[B] Create Reverse Zone
Create ‘rev.ostechnix.com’ file in the ‘/var/named’ directory and add the entries for reverse zone as shown below.
[root@masterdns ~]# vi /var/named/rev.ostechnix.com
$TTL 86400
@ IN SOA masterdns.ostechnix.com. root.ostechnix.com. (
2011071001 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL
)
@IN NS masterdns.ostechnix.com.
@IN NS slavedns.ostechnix.com.
masterdnsIN A 192.168.1.200
slavedns IN A 192.168.1.201
200 IN PTR masterdns.ostechnix.com.
201 IN PTR slavedns.ostechnix.com.
3. Start the bind service
[root@masterdns ~]# service named start
Generating /etc/rndc.key: [ OK ]
Starting named: [ OK ]
[root@masterdns ~]# chkconfig named on
4. Allow DNS Server through iptables
Add the lines shown in bold letters in ‘/etc/sysconfig/iptables’ file. This will allow all clients to access the DNS server.
[root@masterdns ~]# vi /etc/sysconfig/iptables
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -p udp -m state --state NEW --dport 53 -j ACCEPT
-A INPUT -p tcp -m state --state NEW --dport 53 -j ACCEPT
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
5. Restart iptables to save the changes
[root@masterdns ~]# service iptables restart
iptables: Flushing firewall rules: [ OK ]
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Unloading modules: [ OK ]
iptables: Applying firewall rules: [ OK ]
6. Test syntax errors of DNS configuration and zone files
[A] Check DNS Config file
[root@masterdns ~]# named-checkconf /etc/named.conf
[root@masterdns ~]# named-checkconf /etc/named.rfc1912.zones
[B] Check zone files
[root@masterdns ~]# named-checkzone ostechnix.com /var/named/fwd.ostechnix.com
zone ostechnix.com/IN: loaded serial 2011071001
OK
[root@masterdns ~]# named-checkzone ostechnix.com /var/named/rev.ostechnix.com
zone ostechnix.com/IN: loaded serial 2011071001
OK
[root@masterdns ~]#
7. Test DNS Server
Method A:
[root@masterdns ~]# dig masterdns.ostechnix.com
; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.10.rc1.el6_3.6 <<>> masterdns.ostechnix.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 11496
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 1
;; QUESTION SECTION:
;masterdns.ostechnix.com.INA
;; ANSWER SECTION:
masterdns.ostechnix.com. 86400INA192.168.1.200
;; AUTHORITY SECTION:
ostechnix.com.86400INNSmasterdns.ostechnix.com.
ostechnix.com.86400INNSslavedns.ostechnix.com.
;; ADDITIONAL SECTION:
slavedns.ostechnix.com.86400INA192.168.1.201
;; Query time: 5 msec
;; SERVER: 192.168.1.200#53(192.168.1.200)
;; WHEN: Sun Mar 3 12:48:35 2013
;; MSG SIZE rcvd: 110
Method B:
[root@masterdns ~]# dig -x 192.168.1.200
; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.10.rc1.el6_3.6 <<>> -x 192.168.1.200
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 40891
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2
;; QUESTION SECTION:
;200.1.168.192.in-addr.arpa.INPTR
;; ANSWER SECTION:
200.1.168.192.in-addr.arpa. 86400 INPTRmasterdns.ostechnix.com.
;; AUTHORITY SECTION:
1.168.192.in-addr.arpa.86400INNSmasterdns.ostechnix.com.
1.168.192.in-addr.arpa.86400INNSslavedns.ostechnix.com.
;; ADDITIONAL SECTION:
masterdns.ostechnix.com. 86400INA192.168.1.200
slavedns.ostechnix.com.86400INA192.168.1.201
;; Query time: 6 msec
;; SERVER: 192.168.1.200#53(192.168.1.200)
;; WHEN: Sun Mar 3 12:49:53 2013
;; MSG SIZE rcvd: 150
Method C:
[root@masterdns ~]# nslookup masterdns
Server:192.168.1.200
Address:192.168.1.200#53
Name:masterdns.ostechnix.com
Address: 192.168.1.200
Thats it. Now the Primary DNS server is ready
Setup Secondary(Slave) DNS Server
[root@slavedns ~]# yum install bind* -y
1. Configure Slave DNS Server
Open the main configuration file ‘/etc/named.conf’ and add the lines as shown in bold letters.
[root@slavedns ~]# vi /etc/named.conf
//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
options {
listen-on port 53 { 127.0.0.1; 192.168.1.201; }; ## Slve DNS IP ##
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query { localhost; 192.168.1.0/24; }; ## IP Range ##
recursion yes;
dnssec-enable yes;
dnssec-validation yes;
dnssec-lookaside auto;
/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";
managed-keys-directory "/var/named/dynamic";
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "." IN {
type hint;
file "named.ca";
};
zone"ostechnix.com" IN {
type slave;
file "slaves/ostechnix.fwd";
masters { 192.168.1.200; };
};
zone"1.168.192.in-addr.arpa" IN {
type slave;
file "slaves/ostechnix.rev";
masters { 192.168.1.200; };
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
2. Start the DNS Service
[root@slavedns ~]# service named start
Generating /etc/rndc.key: [ OK ]
Starting named: [ OK ]
[root@slavedns ~]# chkconfig named on
Now the forward and reverse zones are automatically replicated from Master DNS server to Slave DNS server.
To verify, goto DNS database location(i.e ‘/var/named/slaves’) and use command ‘ls’.
[root@slavedns ~]# cd /var/named/slaves/
[root@slavedns slaves]# ls
ostechnix.fwd ostechnix.rev
The forward and reverse zones are automatically replicated from Master DNS. Now check the zone files whether the correct zone files are replicated or not.
[A] Check Forward zone:
[root@slavedns slaves]# cat ostechnix.fwd
$ORIGIN .
$TTL 86400; 1 day
ostechnix.comIN SOAmasterdns.ostechnix.com. root.ostechnix.com. (
2011071001 ; serial
3600 ; refresh (1 hour)
1800 ; retry (30 minutes)
604800 ; expire (1 week)
86400 ; minimum (1 day)
)
NSmasterdns.ostechnix.com.
NSslavedns.ostechnix.com.
$ORIGIN ostechnix.com.
masterdnsA192.168.1.200
slavedns A192.168.1.201
[B] Check Reverse zone:
[root@slavedns slaves]# cat ostechnix.rev
$ORIGIN .
$TTL 86400; 1 day
1.168.192.in-addr.arpaIN SOAmasterdns.ostechnix.com. root.ostechnix.com. (
2011071001 ; serial
3600 ; refresh (1 hour)
1800 ; retry (30 minutes)
604800 ; expire (1 week)
86400 ; minimum (1 day)
)
NSmasterdns.ostechnix.com.
NSslavedns.ostechnix.com.
$ORIGIN 1.168.192.in-addr.arpa.
200PTRmasterdns.ostechnix.com.
201PTRslavedns.ostechnix.com.
masterdnsA192.168.1.200
slavedns A192.168.1.201
3. Add the DNS Server details to all systems
[root@slavedns ~]# vi /etc/resolv.conf
# Generated by NetworkManager
search ostechnix.com
nameserver 192.168.1.200
nameserver 192.168.1.201
nameserver 8.8.8.8
4. Test DNS Server
Method A:
[root@slavedns ~]# dig slavedns.ostechnix.com
; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.10.rc1.el6_3.6 <<>> slavedns.ostechnix.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 39096
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 1
;; QUESTION SECTION:
;slavedns.ostechnix.com.INA
;; ANSWER SECTION:
slavedns.ostechnix.com.86400INA192.168.1.201
;; AUTHORITY SECTION:
ostechnix.com.86400INNSmasterdns.ostechnix.com.
ostechnix.com.86400INNSslavedns.ostechnix.com.
;; ADDITIONAL SECTION:
masterdns.ostechnix.com. 86400INA192.168.1.200
;; Query time: 7 msec
;; SERVER: 192.168.1.200#53(192.168.1.200)
;; WHEN: Sun Mar 3 13:00:17 2013
;; MSG SIZE rcvd: 110
Method B:
[root@slavedns ~]# dig masterdns.ostechnix.com
; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.10.rc1.el6_3.6 <<>> masterdns.ostechnix.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 12825
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 1
;; QUESTION SECTION:
;masterdns.ostechnix.com.INA
;; ANSWER SECTION:
masterdns.ostechnix.com. 86400INA192.168.1.200
;; AUTHORITY SECTION:
ostechnix.com.86400INNSmasterdns.ostechnix.com.
ostechnix.com.86400INNSslavedns.ostechnix.com.
;; ADDITIONAL SECTION:
slavedns.ostechnix.com.86400INA192.168.1.201
;; Query time: 13 msec
;; SERVER: 192.168.1.200#53(192.168.1.200)
;; WHEN: Sun Mar 3 13:01:02 2013
;; MSG SIZE rcvd: 110
Method C:
[root@slavedns ~]# nslookup slavedns
Server:192.168.1.200
Address:192.168.1.200#53
Name:slavedns.ostechnix.com
Address: 192.168.1.201
Method D:
[root@slavedns ~]# nslookup masterdns
Server:192.168.1.200
Address:192.168.1.200#53
Name:masterdns.ostechnix.com
Address: 192.168.1.200
Method E:
[root@slavedns ~]# dig -x 192.168.1.201
; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.10.rc1.el6_3.6 <<>> -x 192.168.1.201
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 56991
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2
;; QUESTION SECTION:
;201.1.168.192.in-addr.arpa.INPTR
;; ANSWER SECTION:
201.1.168.192.in-addr.arpa. 86400 INPTRslavedns.ostechnix.com.
;; AUTHORITY SECTION:
1.168.192.in-addr.arpa.86400INNSmasterdns.ostechnix.com.
1.168.192.in-addr.arpa.86400INNSslavedns.ostechnix.com.
;; ADDITIONAL SECTION:
masterdns.ostechnix.com. 86400INA192.168.1.200
slavedns.ostechnix.com.86400INA192.168.1.201
;; Query time: 6 msec
;; SERVER: 192.168.1.200#53(192.168.1.200)
;; WHEN: Sun Mar 3 13:03:39 2013
;; MSG SIZE rcvd: 150
Method F:
[root@slavedns ~]# dig -x 192.168.1.200
; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.10.rc1.el6_3.6 <<>> -x 192.168.1.200
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 42968
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2
;; QUESTION SECTION:
;200.1.168.192.in-addr.arpa.INPTR
;; ANSWER SECTION:
200.1.168.192.in-addr.arpa. 86400 INPTRmasterdns.ostechnix.com.
;; AUTHORITY SECTION:
1.168.192.in-addr.arpa.86400INNSslavedns.ostechnix.com.
1.168.192.in-addr.arpa.86400INNSmasterdns.ostechnix.com.
;; ADDITIONAL SECTION:
masterdns.ostechnix.com. 86400INA192.168.1.200
slavedns.ostechnix.com.86400INA192.168.1.201
;; Query time: 4 msec
;; SERVER: 192.168.1.200#53(192.168.1.200)
;; WHEN: Sun Mar 3 13:04:15 2013
;; MSG SIZE rcvd: 150
資料來源:http://ostechnix.wordpress.com/2013/12/15/setup-dns-server-step-by-step-in-centos-6-3-rhel-6-3-scientific-linux-6-3-3/
訂閱:
文章 (Atom)