以前這種動態DNS 是在ADSL / 光世代, 還沒這種1個固IP / 7個浮動IP 方式的時候假站必備的軟體之一
記IP又沒有用,每24小時會更換一次,,這個時候就需要這種套件了
~]$ yum info ddclient.noarch
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirror01.idc.hinet.net
* epel: mirror01.idc.hinet.net
* extras: mirror01.idc.hinet.net
* updates: mirror01.idc.hinet.net
Available Packages
Name : ddclient
Arch : noarch
Version : 3.8.3
Release : 2.el7
Size : 61 k
Repo : epel/x86_64
Summary : Client to update dynamic DNS host entries
URL : http://ddclient.sourceforge.net/
License : GPLv2+
Description : ddclient is a Perl client used to update dynamic DNS entries for accounts
: on many different dynamic DNS services. Features include: Operating as a
: daemon, manual and automatic updates, static and dynamic updates, optimized
: updates for multiple addresses, MX, wildcards, abuse avoidance, retrying
: the failed updates and sending update status to syslog and through e-mail.
================================================================================
開始安裝吧
~]$ sudo yum install -y ddclient.noarch
Dependency Installed:
perl-Digest-SHA1.x86_64 0:2.13-9.el7 perl-IO-Socket-IP.noarch 0:0.21-5.el7 perl-IO-Socket-SSL.noarch 0:1.94-7.el7 perl-Mozilla-CA.noarch 0:20130114-5.el7
perl-Net-LibIDN.x86_64 0:0.12-15.el7 perl-Net-SSLeay.x86_64 0:1.55-6.el7
Complete!
看到complete! 就是完成了
進去開始設定吧
~]$ sudo vim /etc/ddclient.conf
######################################################################
保持預設不動
daemon=300 # check every 300 seconds
syslog=yes # log update msgs to syslog
#mail=root # mail all msgs to root
mail-failure=root # mail failed update msgs to root
pid=/var/run/ddclient/ddclient.pid # record PID in file.
ssl=yes # use ssl-support. Works with
# ssl-library
# postscript=script # run script after updating. The
# new IP is added as argument.
######################################################################
按照提示的部份輸入資訊
#use= # via static IP's
use=if, if=ppp0 # via interfaces (如果你是撥接上網,大部份應該是這個ppp0)
#use=web # via web
protocol=dyndns2 # default protocol (unmark # 使用這個protocal)
#proxy=fasthttp.sympatico.ca:80 # default proxy
server=members.dyndns.org # default server (unmark # 使用這個Server)
#server=members.dyndns.org:8245 # default server (bypassing proxies)
login= # default login (輸入你在Dyndns的使用者名稱)
password= # default password (輸入你在Dyndns的密碼)
#mx=mx.for.your.host # default MX
#backupmx=yes|no # host is primary MX?
#wildcard=yes|no # add wildcard CNAME?
######################################################################
按照提示的部份輸入資訊
##
## dyndns.org dynamic addresses
##
## (supports variables: wildcard,mx,backupmx)
##
server=members.dyndns.org, \ (unmark # 使用這個Server)
protocol=dyndns2 \ (unmark # 使用這個protocal)
xxxxxx.dyndns.org # your-dynamic-host.dyndns.org (在#前面 輸入你申請好的動態網域名)
以上設定好後就存檔離開
~]$ sudo ddclient -daemon=0 -debug -verbose -noquiet
用這組指令測試一下
RECEIVE: xxx.xxx.xxx.xxx
SUCCESS: updating xxxxxxx.dyndns.org: good: IP address set to xxx.xxx.xxx.xxx
有看到SUCCESS 將你申請好的動態網域名對定到現有的IP就可以了