Dynamic DNS
การติดตั้ง Dynamic DNS Client (ddclient)
1. ติดตั้ง ddclient จาก YaST
YaST -> Software -> Install -> ddclient
# cd /usr/share/doc/packages/ddclient/
# cp sample-etc_rc.d_init.d_ddclient/
# cp sample-etc_ppp_ip-up.local /etc/ppp/ip-up.local
# vi /etc/ddclient
เพิ่มคำสั่งนี้เข้าไป ล่างสุด
## Additional line by SuSEThailand.com
daemon=300 # Number of seconds before IP address is checked again
ค่าเวลาที่จะทำการ Update เป็นวินาทีsyslog=yes # Log update messages to syslog
ทำการ update log filemail-failure=root # Mail only failed updates to root
ส่งเมล์ให้ root@hostname pid=/var/run/ddclient.pid # Records the Process ID of ddclient
use=web, web=checkip.dyndns.ort/ , web-skip='192.168.1.13' # Checks with DynDNS what your externally facing IP address is,
protocol=dyndns2 # The protocol DynDNS use for Dynamic DNS
server=members.dyndns.org # The DynDNS server that manages your IP address and DNS resolution
login=userlogin # Your DynDNS login name
password=password # Your DynDNS password
wildcard=yes # Use wildcard DNS CNAME
myhost.dyndns.org # My host name
2. สร้าง Script init.d สำหรับ RunLevel
# vi /etc/init.d/ddclient
#!/bin/sh
### BEGIN INIT INFO
# Provides: ddclient
# Required-Start: $syslog $local_fs $network
# Should-Start: $time ypbind sendmail $remote_fs
# Required-Stop: $syslog $local_fs
# Should-Stop: $time ypbind sendmail $remote_fs
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: ddclient a daemon to update dynamic DNS entries
# Description: ddclient is a Perl client used to update dynamic DNS
# entries for accounts on many dynamic DNS services and
# can be used on many types of firewalls
### END INIT INFO
#
# Source SuSE config, only if exists with size greater zero
test -s /etc/rc.status && . /etc/rc.status
DDCLIENT_SYSCONFIG=/etc/sysconfig/ddclient
DDCLIENT_CONFIG=/etc/ddclient.conf
DDCLIENT_BIN=/usr/sbin/ddclient
test -s "$DDCLIENT_CONFIG" || exit 6
test -s "$DDCLIENT_SYSCONFIG" && . "$DDCLIENT_SYSCONFIG"
dd_intervall=${DDCLIENT_INTERVALL:-300}
rc_reset
case "$1" in
start)
echo -n "Starting ddclient daemon"
startproc "$DDCLIENT_BIN" -daemon $dd_intervall $DDCLIENT_OPTIONS
rc_status -v
;;
stop)
echo -n "Shutting down ddclient daemon"
killproc -TERM `basename "$DDCLIENT_BIN"`
rc_status -v
;;
try-restart)
$0 status >/dev/null && $0 restart
# Remember status and be quiet
rc_status
;;
restart)
$0 stop
$0 start
rc_status
;;
force-reload)
# echo -n "Reload service ddclient"
rc_failed 3
rc_status -v
;;
reload)
rc_failed 3
rc_status -v
;;
status)
echo -n "Checking for service ddclient "
checkproc `basename "$DDCLIENT_BIN"`
rc_status -v
;;
*)
echo "Usage: ddclient {start|stop|try-restart|restart|status}"
exit 1
esac
rc_exit
3. คำสั่ง
# rcddclient start
# rcddclient restart
# rcddclient stop
4. ทำให้ ddclient client รันตอนเปิดเครื่อง
YaST -> System -> Systerm Services (Runlevel) -> เลือก ddclient แล้วก็คลิก Enable service
5. ทดสอบ
# ping myhost.dyndns.org
เสร็จขั้นตอนการทำ Dynamic DNS Client โดยใช้ ddclient แล้วครับ.

SUSE Linux Enterprise Cool Solutions
|







