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
以后開機會自動更新
posted on 2008-08-26 23:55
七匹狼 閱讀(3197)
評論(1) 編輯 收藏 所屬分類:
linux