dynamic DNS

Category: /knowledge /linux
Tags: linux DNS website

Linux clients

ddclient

 cp ddclient /usr/sbin/
 mkdir /etc/ddclient
 mkdir /var/cache/ddclient
 cp sample-etc_ddclient.conf /etc/ddclient/ddclient.conf
 vi /etc/ddclient/ddclient.conf
 -- and change hostnames, logins, and passwords appropriately
 cp sample-etc_rc.d_init.d_ddclient.ubuntu /etc/init.d/ddclient
 ## enable automatic startup when booting
 ## check your distribution
 chkconfig --add ddclient
 ## start the first time by hand
 /etc/init.d/ddclient start

Send IP to a place

send_ip.sh:

#!/bin/sh

ip_addr=$HOME/doc/dyn.ip.html
wget http://checkip.dyndns.org -O ${ip_addr}
scp ${ip_addr} username@$dest.com:~/doc/

cron job: send the IP everyday

# m h  dom mon dow   command
* */12 * * * /home/username/bin/send_ip.sh

评论

提示

  • 如果看不到评论部分, 请暂时关掉adblock in Firefox/Chrome
  • 本网站使用Javascript实现评论功能, 此处外链对提高您的网站PR没有帮助. (潜台词: 请不要灌水, 谢谢)