ddclient jest programem napisanym w Perlu który umożliwia dynamiczną aktualizację kont w różnych serwisach DNS. Oryginalnie został napisany przez Paula Burrya i jest rozwijany przez grupę developerów na sourceforg.
ddclient jest mały i potrzebuje tylko języka Perl do poprawnego funkcjonowania – żadnych innych modułów. Może być uruchamiany pod większością systemów z rodziny UNIX, był testowany na GNU/Linux oraz FreeBSD. Wspiera takie mechanizmy jak:
- może być uruchomiony jako deamon
- umożliwia manualne jak i automatyczne uaktualnienie IP
- obsługuje statyczne jak i dynamiczne IP
- został zoptymalizowany pod kątem obsługi wielu adresów jednocześnie
- obsługuje MX, wildcards,
- zapobiega niepotrzebnym uaktualnieniom
- powtarza próby uaktualnienia w razie porażki
- w pełni kompatybilny z syslogd oraz umożliwia powiadamianie administratora via email
Pobieramy paczkę ze strony
http://sourceforge.net/project/showfiles.php?group_id=116817
Polecenie:
# fetch http://mesh.dl.sourceforge.net/sourceforge/ddclient/ddclient-3.6.6.tar.gz
Rozpakowujemy:
# tar -xvf /root/ddclient-3.6.6.tar.gz
Wchodzimy do folderu z ddclient:
# cd ddclient-3.6.6
Instalujemy (jeśli można to tak nazwać)
# cp ddclient /usr/sbin/
# cp sample-etc_ddclient.conf /usr/local/etc/ddclient.conf
# chmod 600 ddclient.conf
Przykładowy plik ddclient.conf (plik różni się troszkę od
sample-etc_ddclient.conf )
######################################################################
## Define default global variables with lines like:
## var=value [, var=value]*
## These values will be used for each following host unless overridden
## with a local variable definition.
##
## Define local variables for one or more hosts with:
## var=value [, var=value]* host.and.domain[,host2.and.domain...]
##
## Lines can be continued on the following line by ending the line
## with a \
##
######################################################################
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.pid # record PID in file.
#
## To obtain an IP address from hardware status
#use=watchguard-soho, fw=192.168.111.1:80 # via Watchguard's SOHO FW
#use=netopia-r910, fw=192.168.111.1:80 # via Netopia R910 FW
#use=smc-barricade, fw=192.168.123.254:80 # via SMC's Barricade FW
#use=netgear-rt3xx, fw=192.168.0.1:80 # via Netgear's internet FW
#use=linksys, fw=192.168.1.1:80 # via Linksys's internet FW
#use=maxgate-ugate3x00, fw=192.168.0.1:80 # via MaxGate's UGATE-3x00 FW
#use=elsa-lancom-dsl10, fw=10.0.0.254:80 # via ELSA LanCom DSL/10 DSL Router
#use=elsa-lancom-dsl10-ch01, fw=10.0.0.254:80 # via ELSA LanCom DSL/10 DSL
Router
#use=elsa-lancom-dsl10-ch02, fw=10.0.0.254:80 # via ELSA LanCom DSL/10 DSL
Router
#use=alcatel-stp, fw=10.0.0.138:80 # via Alcatel Speed Touch Pro
#use=xsense-aero, fw=192.168.1.1:80 # via Xsense Aero Router
#use=allnet-1298, fw=192.168.1.1:80 # via AllNet 1298 DSL Router
#use=3com-oc-remote812, fw=192.168.0.254:80 # via 3com OfficeConnect Remote 812
#use=e-tech, fw=192.168.1.1:80 # via E-tech Router
#use=cayman-3220h, fw=192.168.0.1:1080 # via Cayman 3220-H DSL Router#
#
#
#fw-login=admin, fw-password=XXXXXX # FW login and password
#
#
## To obtain an IP address from FW status page (using fw-login, fw-password)
#use=fw, fw=192.168.1.254/status.htm, fw-skip='IP Address' # found after IP
Address
#
#
## To obtain an IP address from Web status page (using the proxy if defined)
use=web, web=checkip.dyndns.org:8245/, web-skip='IP Address' # found after IP
Address
#
#
## To obtain an IP address from other system status
#use=ip, ip=127.0.0.1 # via static IP's
#use=if, if=tun0 # via interfaces
#use=web # via web
#
#
## Setings
#protocol=dyndns2 # default protocol
#proxy=fasthttp.sympatico.ca:80 # default proxy
#server=members.dyndns.org # default server
#server=members.dyndns.org:8245 # default server (bypassing proxies)
login=LOGIN-DYNDNS # default login
password=PASS-DYNDNS # default password
#mx=mx.for.your.host # default MX
#backupmx=yes|no # host is primary MX?
#wildcard=yes|no # add wildcard CNAME?
#
## Host setings
#
## dyndns.org dynamic addresses
##
## (supports variables: wildcard,mx,backupmx)
##
server=members.dyndns.org, \
protocol=dyndns2 \
tralala.mine.nu
##
## dyndns.org static addresses
##
## (supports variables: wildcard,mx,backupmx)
##
# static=yes, \
# server=members.dyndns.org, \
# protocol=dyndns2 \
# your-static-host.dyndns.org
##
##
## dyndns.org custom addresses
##
## (supports variables: wildcard,mx,backupmx)
##
custom=yes, \
server=members.dyndns.org, \
protocol=dyndns2 \
tralala.com,papa.tralala.com
##
## ZoneEdit (zoneedit.com)
##
# server=www.zoneedit.com, \
# protocol=zoneedit1, \
# login=your-zoneedit-login, \
# password=your-zoneedit-password \
# your.any.domain,your-2nd.any.dom
##
## EasyDNS (easydns.com)
##
# server=members.easydns.com, \
# protocol=easydns, \
# login=your-easydns-login, \
# password=your-easydns-password \
# your.any.domain,your-2nd.any.domain
##
## Hammernode (hn.org) dynamic addresses
##
# server=dup.hn.org, \
# protocol=hammernode1, \
# login=your-hn-login, \
# password=your-hn-password \
# your-hn-host.hn.org,your-2nd-hn-host.hn.org
##
## dslreports.com dynamic-host monitoring
##
# server=members.dslreports.com \
# protocol=dslreports1, \
# login=dslreports-login, \
# password=dslreports-password \
# dslreports-unique-id
## ## OrgDNS.org account-configuration
##
# use=web, web=members.orgdns.org/nic/ip
# server=www.orgdns.org \
# protocol=dyndns2 \
# login=yourLoginName \
# password=yourPassword \
# yourSubdomain.orgdns.org
##
## dnspark.com
## (supports variables: mx, mxpri)
##
# use=web, web=ipdetect.dnspark.com, web-skip='Current Address:'
# protocol=dnspark, \
# server=www.dnspark.com, \
# your-host.dnspark.com
##
## NameCheap (namecheap.com)
##
# protocol=namecheap, \
# server=dynamicdns.park-your-domain.com, \
# login=my-namecheap.com-login, \
# password=my-namecheap.com-password \
# myhost.namecheap.com |
Tworzymy plik startowy ddclient
# touch /usr/local/etc/rc.d/ddclient.sh
Do pliku wpisujemy:
#!/bin/sh
#
# ddclient This shell script takes care of starting and stopping
# ddclient.
CONFIG='-file /usr/local/etc/ddclient.conf'
CACHE='-cache /var/db/ddclient.cache'
case "$1" in
start)
# Start deamon
if [ -e /var/run/ddclient.pid ]; then
echo "DDClient is already running -
pid" `cat /var/run/ddclient.pid`
else
echo "Starting ddclient."
ddclient $CONFIG $CACHE -daemon 300
#-debug -verbose -noquiet
fi
;;
stop)
# Stop daemon.
echo -n "Stoping ddclient."
kill -TERM `cat /var/run/ddclient.pid`
echo
;;
restart)
# Restart deamon
if [ -e /var/run/ddclient.pid ]; then
kill -TERM `cat /var/run/ddclient.pid`
echo "DDClient have beed just stoped"
rm /var/run/ddclient.pid
$0 start
else
echo "Before restart you must run DDClient"
fi
;;
status)
# Get deamon status
if [ -e /var/run/ddclient.pid ]; then
echo "DDClient is running - pid" `cat /var/run/ddclient.pid`
else
echo "DDClient isnt working now"
fi
;;
*)
echo "Usage: ddclient {start|stop|restart|status}"
exit 1
esac
exit 0
|
I nadajemy mu odpowiednie prawa
# chmod 0700 /usr/local/etc/rc.d/ddclient.sh
Jeśli chcesz włączyć funkcję debugera w pliku ddclient.sh zamień w sekcji start)
ddclient $CONFIG $CACHE -daemon 300
|
na
ddclient $CONFIG $CACHE -daemon 300 -debug -verbose -noquiet
|
Przydałoby się jeszcze, aby wszystkie wiadomości z debugera nie leciały do /var/log/messages
Tworzymy więc plik /var/log/ddclient.log
# touch /var/log/ddclient.log
I edytujemy /etc/syslog.log
# ee /etc/syslog.conf
Dopisujemy na samym końcu pliku:
!ddclient
*.* /var/log/ddclient.log
|
Restartujemy syslogd
# killall –HUP syslogd
Uruchamiamy DDClient
# /usr/local/etc/rc.d/ddclient.sh start
Więcej informacji na temat ddclient możesz znaleźć w helpie ddclient:
# /usr/sbin/ddclient --help
Autor: Artur 'Zdolny' Zdoliński
zdolny(at)poczta.onet.pl
Copyright @ Zdolny Warszawa
Tylko zarejestrowani użytkownicy mogą pisać komentarze. Prosze zaloguj się i dodaj komentarz. Powered by AkoComment! |