Following are my notes for configuring ddclient on the RPi so that it updates Hurricane Electric's dynamic DNS.
First off, my configuration:
- I run dyndns on my router to update DynDNS (for a dynamic domain). This is independent of the below and exists for other reasons.
- I run ddclient on the Raspberry Pi (for a dynamic host/IP in a permanent domain) to allow my XMPP server to be "visible" on the Internet.
- I purchased a domain from hover.com and edited the nameserver records so that they point to Hurricane Electric's free DNS servers.
Mathieu Lutfy has a good howto for doing setting up ddclient. It only needed a little tweaking to get it working for my use. Steps:
- Point a browser at https://dns.he.net.
- Log on (upper left) or register (see opening paragraphs) and then log on.
- Set up your domain in the Hurricane Electric DNS server (outside of the scope of this howto).
- To add a dynamic record, click on "New A".
- Enter the hostname that will be dynamic and check the box (near the bottom) for "Enable entry for dynamic dns". This will populate the IP and TTL entries.
- Click submit. This will take you back to your zone listing.
- In the DDNS column, you should see a "refresh" icon. Click on that. It will ask you to provide the key to be used for authenticating the host with the service. Near the bottom is a green "Generate" button that will auto-generate the key. This key will be the password in your ddclient.conf file.
- Install ddclient via the usual means (for Ubuntu, this would be "apt-get install ddclient"). Immediately, manually kill the ddclient process as the shutdown script does NOT work properly and will not kill the daemon. You will want to wait five minutes (the TTL setting from the above) before running the service again.
- In the meantime, use your favorite editor to edit /etc/ddclient.conf. Make it look something like the below:
# Configuration file for ddclient generated by debconf
With the exception of the obvious hostname entries, the above differs from Mathieu Lutfy's configuration only on the "use" line. His configuration indicates that his box is directly connected to the Internet in that "use=if, if=ppp0" grabs the IP locally and provides it to the DNS server. The configuration above indicates that ddclient is running on an internal box (i.e., behind by firewall). "use=web" causes the server end to determine the external IP.
- Start the ddclient service and check your log files (for Ubuntu, this is /var/run/daemon.log). You should see an entry somewhat like:
Jun 18 05:30:57 pi1 ddclient: SUCCESS: updating yourhost.yourdomain.com: good: IP address set to YourExternalIP
If you don't see that, ddclient will generate a number of entries which can be used to troubleshoot the error. Please heed any warning to not attempt update before 5 minutes has passed (sending a corrected entry too soon will be ignored).