1.首先下載ddclient
[url]https://www.dyndns.com/download/clients/unix/ddclient.tar.gz[/url]
2.解壓ddclient.tar.gz
3.將ddclient檔案拷貝到/usr/sbin/
#cp ddclient /usr/sbin/
4.建立 /etc/ddclient 目錄
#mkdir /etc/ddclient
5.拷貝sample-etc_ddclient.conf檔案到 /etc/ddclient/並重新命名為ddclient.conf
#cp sample-etc_ddclient.conf /etc/ddclient/ddclient.conf
6.編輯ddclient.conf(最重要的一步)
dyndns主要支援 DynDNS.org hn.org Zoneedit.com easydns.com dnspark.com OrgDNS.org dslreports. com namecheap.com ,其中zoneedit 可綁定頂級網域名稱且是免費的。(還有幾個是免費的,我沒有實驗,至於zoneedit的用法請自己搜尋)所以要修改
#use=web, web=checkip.dyndns.org/, web-skip='IP Address' # found after IP Address
# server=www.zoneedit.com, /
# protocol=zoneedit1, /
# login=your-zoneedit-login, /
# password=your-zoneedit-password /
# your.any.domain,your-2nd.any.dom
為
#use=web, web=checkip.dyndns.org/, web-skip='IP Address' # found after IP Address
use=web, web=www.ip138.com/, web-skip='您的IP地址是:' # found after IP Address
server=www.zoneedit.com, /
protocol=zoneedit1, /
login=你在zoneedit的使用者名稱 , /
password=密碼 /
your.any.domain,your-2nd.any.dom (要更新的網域名稱)
我覺得用 use=web,這個最簡單方便,不管是外網還是內網,獲得的ip都是公網ip,同時這對adsl router使用者來說更好的一點就是,每隔一段時間程式就串連一次[url]www.ip138.com[/url],保證adsl串連不斷開(因為adsl router一段時間沒有流量會自動掛斷串連)。唯一的缺點,如果[url]www.ip138.com[/url]掛了,你的網站也要掛,哈哈,不過就本人使用ip138.com還沒發現它掛過。還有幾種獲得ip的方法,像擷取網卡地址,擷取防火牆地址,擷取router地址,大家可以自己實驗下。
7.拷貝sample-etc_rc.d_init.d_ddclient 檔案到 /etc/rc.d/並重新命名為ddclient
#cp sample-etc_rc.d_init.d_ddclient /etc/rc.d/init.d/ddclient
8.編輯/etc/rc.d/rc.local ,加入如下一行:
/etc/rc.d/init.d/ddclient start
9.手動更新一次
#/etc/rc.d/init.d/ddclient start
以後開機會自動更新