Dynamic DNS

Written by

in

, ,

MyDNS.jp

I use MyDNS.jp for Dynamic DNS server.

IP Notification

Install required softwares

$ sudo pacman -S cronie wget

Setup IP Notification script

$ sudo vi /etc/cron.hourly/mydns
#!/bin/sh
wget -q -O- http://[ID]:[PASS]@ipv4.mydns.jp/login.html > /dev/null 2>&1
wget -q -O- http://[ID]:[PASS]@ipv6.mydns.jp/login.html > /dev/null 2>&1

Notice: Here [ID] is your ID, [PASS] is your Password.

Change the permission of the script.

$ sudo chmod 755 /etc/cron.hourly/mydns

Set crontab hourly.

$ sudo crontab -e
58 * * * * /etc/cron.hourly/mydns

Notice: DON’T include “.” character in your cron script file name. If it is included, the script would not work properly.

Auto Notify on reboot

To notifiy IP address on reboot automatically, edit cron tab like bellow.

$ sudo crontab -e
@reboot sleep 45; /etc/cron.hourly/mydns

Here, a sleep timer is set to 45 seconds. This timer is required because mydns script should be loaded after the network system has started completely.
Though this timer value is system dependent, in my experient, 40 to 50 would be a nice value.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *