【Unix-like】DNS-浮動IP申請
對於架主機的人來說
pppoe最頭疼的就是每次得到的IP都不相同,
這樣要怎麼從外面連到自已家的主機呢?
在WIN底下有DynDNS Updater這套軟體好用!
那…在FreeBSD、Linux/UNIX-like OS底下呢@@?
呵呵別擔心~當然也有啊!
=========================
【申請DynDNS 帳號】
首先我們先去申請一個免費的 host name
這邊提供一個本人自已在用的網站DynDNS
1. 點選『Create Account'連結
點選右上角的『Create Account' 申請帳號。
2. 填寫帳號資訊後,點按下方的『Create Account'按鈕
資料填完之後就是DynDNS的會員囉:3
3. 打開信箱,收取郵件
4. 點選帳號啟動連結
(網路上還有很多其他免費的動態DNS,有興趣的朋友可以自行去找找)
【設定Hostname】
接下來要申請一個動態的DNS(Dynamic DNS)
點選 >>點選 >>點選
>>點選
>>點選
>>設好喜歡的『Hostname』、選擇『Service Type』及填入目前的『IP Address』,最後按下右下方的『Add to Cart』 按鈕,這樣就申請完了^^!
再次登入,點選左方圖示連結,進入下面畫面,並點選右下方『Next>>』按鍵。
進入下方的頁面,點選右下方『Activate Services>>』,令剛申請、設定的Hostname生效。
ddclient=============================
為了不想每次重開或斷線後就要上DynDNS去更新ip
我們要來安裝一個可以自動連上DynDNS更新IP的Update軟體
【Download ddclient】
DynDNS站上就能下載到這套軟體:ddclient
下載下來後解壓解包它 ddclient.tar.gz
# wget -c http://cdn.dyndns.com/
# tar -zxvf ddclient.tar.gz
解開後就看到這個ddclient-3.7.3 的目錄
安裝的方法可以cat 一下README
******************************
【INSTALLATION】
# sudo cp ddclient /usr/local/bin/
# sudo mkdir /etc/ddclient
# sudo mkdir /var/cache/ddclient
# sudo cp sample-etc_ddclient.conf /etc/ddclient/ddclient.conf
# touch /var/cache/ddclient/ddclient.cache
# sudo chown -R root:root /etc/ddclient
# sudo vi /etc/ddclient/ddclient.conf
-- and change hostnames, logins, and passwords appropriately
******************************
(for Ubuntu,Fedora,Linux/Unix-like)
【修改 /etc/ddclient/ddclient.conf 內容】
>use=if, if=ppp0
>login=jackiexie
>password=xxxxxxxxx
>server=members.dyndns.org
>protocol=dyndns2
>jackiexie.blogsite.org
>EOF
# cat /etc/ddclient/ddclient.conf
daemon=300 protocol=dyndns2 |
----------------------------------------------
【測試】
# ddclient -daemon=0 -debug -verbose -noquie
=== opt ====
opt{cache}
opt{cmd}
opt{cmd-skip}
opt{daemon}
opt{debug}
opt{exec}
opt{facility}
opt{file}
opt{force}
opt{fw}
opt{fw-login}
opt{fw-password}
opt{fw-skip}
opt{geturl}
opt{help}
opt{host}
opt{if}
opt{if-skip}
opt{ip}
opt{login}
opt{mail}
opt{mail-failure}
opt{max-interval}
opt{min-error-interval}
opt{min-interval}
opt{options}
opt{password}
opt{pid}
opt{priority}
opt{protocol}
opt{proxy}
opt{query}
opt{quiet}
opt{retry}
opt{server}
opt{ssl}
opt{syslog}
opt{test}
opt{timeout}
opt{use}
opt{verbose}
opt{web}
opt{web-skip}
=== globals ====
globals{daemon}
globals{debug}
globals{if}
globals{login}
globals{mail}
globals{mail-failure}
globals{password}
globals{pid}
globals{protocol}
globals{quiet}
globals{server}
globals{ssl}
globals{syslog}
globals{use}
globals{verbose}
=== config ====
config{jackiexie.blogsite.org}{atime} : 1255678252
config{jackiexie.blogsite.org}{backupmx} : 0
config{jackiexie.blogsite.org}{cacheable} : ARRAY(0x1f82e68)
config{jackiexie.blogsite.org}{custom} : 0
config{jackiexie.blogsite.org}{host} : jackiexie.blogsite.org
config{jackiexie.blogsite.org}{ip} : xxx.xxx.xxx.xxx
config{jackiexie.blogsite.org}{login} : jackiexie
config{jackiexie.blogsite.org}{max-interval} : 2160000
config{jackiexie.blogsite.org}{min-error-
config{jackiexie.blogsite.org}{min-interval} : 30
config{jackiexie.blogsite.org}{mtime} : 1255678252
config{jackiexie.blogsite.org}{mx} :
config{jackiexie.blogsite.org}{password} : xxxxxxx
config{jackiexie.blogsite.org}{protocol} : dyndns2
config{jackiexie.blogsite.org}{server} : members.dyndns.org
config{jackiexie.blogsite.org}{static} : 0
config{jackiexie.blogsite.org}{status} : good
config{jackiexie.blogsite.org}{warned-min-
config{jackiexie.blogsite.org}{warned-min-
config{jackiexie.blogsite.org}{wildcard} : 0
config{jackiexie.blogsite.org}{wtime} : 30
=== cache ====
cache{jackiexie}{atime}
cache{jackiexie}{
cache{jackiexie}{custom}
cache{jackiexie}{host}
cache{jackiexie}{mtime}
cache{jackiexie}{mx}
cache{jackiexie}{static}
cache{jackiexie}{status}
cache{jackiexie}{warned-
cache{d jackiexie}{warned-
cache{jackiexie}{
cache{jackiexie}{wtime}
cache{ jackiexie.blogsite.org}{atime} : 1255678252
cache{jackiexie.blogsite.org}{backupmx} : 0
cache{jackiexie.blogsite.org}{custom} : 0
cache{jackiexie.blogsite.org}{host} : jackiexie.blogsite.org
cache{jackiexie.blogsite.org}{ip} : xxx.xxx.xxx.xxx
cache{jackiexie.blogsite.org}{mtime} : 1255678252
cache{jackiexie.blogsite.org}{mx} :
cache{jackiexie.blogsite.org}{static} : 0
cache{jackiexie.blogsite.org}{status} : good
cache{jackiexie.blogsite.org}{warned-min-error-
cache{jackiexie.blogsite.org}{warned-min-interval} : 0
cache{jackiexie.blogsite.org}{wildcard} : 0
cache{jackiexie.blogsite.org}{wtime} : 30
DEBUG: get_ip: using if, ppp0 reports xxx.xxx.xxx.xxx
DEBUG:
DEBUG: nic_dyndns2_update -------------------
INFO: setting IP address to xxx.xxx.xxx.xxx for jackiexie.blogsite.org
UPDATE: updating jackiexie.blogsite.org
DEBUG: proxy =
DEBUG: url = http://members.dyndns.org/nic/
DEBUG: server = members.dyndns.org
CONNECT: members.dyndns.org
CONNECTED: using SSL
SENDING: GET /nic/update?system=dyndns&
SENDING: Host: members.dyndns.org
SENDING: Authorization: Basic ZG5pLW5ldHdvcmtpbmc6ZG5pbmV0d2
SENDING: User-Agent: ddclient/3.7.3
SENDING: Connection: close
SENDING:
RECEIVE: HTTP/1.1 200 OK
RECEIVE: Date: Fri, 16 Oct 2009 07:52:14 GMT
RECEIVE: Server: Apache
RECEIVE: Content-Type: text/plain
RECEIVE: Connection: close
RECEIVE:
RECEIVE: good xxx.xxx.xxx.xxx
SUCCESS: updating jackiexie.blogsite.org: good: IP address set to xxx.xxx.xxx.xxx
進dyndns>>My Services>>Host Services,查看ip是否已經改變
留言列表