DDClient & Namecheap.com on Ubuntu 16.06
TL;DR
For the benefit of my new engagement I am setting up some Amazon Web Services ec2 instances and I don't want to pay for static ipv4.
I have my own domain hosted with namecheap.com and I have full control over it.
Tried to configure ddclient on Ubuntu 16.06 and it just would not update the dynamic ip when ec2 instance is shutdown and then started using aws console.
Searching the web, as usual, resulted in conflicting info on how to troubleshoot
Here is what has worked for me
Namecheap.com Configuration
- Login into your account on namecheap.com
- Select 'manage' next to the domain where you want to configure the ddns (dynamic domain name service) record
- Select 'Advanced Dns' tab
- Add new host under the 'DYNAMIC DNS', just host name, not the FQDN (fully qualified domain name)
- Put a dummy ip address e.g. 10.0.0.1
- Copy the password for ddns labelled 'Dynamic DNS Password'
Installing ddclient on Ubuntu 16.06
sudo apt-get update && sudo apt-get install ddclient -y
You can skip all the questions ddclient installation UI is asking and I have not bothered yet to suppress the questions during the installation.
/etc/ddclient.conf
# Configuration file for ddclient generated by debconf
#
# /etc/ddclient.conf
# FQDN: vkhazin.end-points.io
#I have found that namecheap.com recommended url tends to hang the domain
use=web, web=ipinfo.io/ip
protocol=namecheap
server=dynamicdns.park-your-domain.com
#You don't want you password running through the internet in clear text, do you?
ssl=yes
#Replace with your domain name, not with host FQDN!
login=end-points.io
password=
#Replace with your hostname, not FQDN!
vkhazin
/etc/default/ddclient.conf
# Configuration for ddclient scripts
# generated from debconf on Wed May 3 15:31:48 UTC 2017
#
# /etc/default/ddclient
# Set to "true" if ddclient should be run every time DHCP client ('dhclient'
# from package isc-dhcp-client) updates the systems IP address.
run_dhclient="false"
# Set to "true" if ddclient should be run every time a new ppp connection is
# established. This might be useful, if you are using dial-on-demand.
run_ipup="false"
# Set to "true" if ddclient should run in daemon mode
# If this is changed to true, run_ipup and run_dhclient must be set to false.
run_daemon="true"
# Set the time interval between the updates of the dynamic DNS name in seconds.
# This option only takes effect if the ddclient runs in daemon mode.
daemon_interval="300"
/etc/init.d/ddclient
...truncated...
run_daemon="true"
daemon_interval=300
Testing
- sudo systemctl daemon-reload
- sudo service ddclient restart
- sudo service ddclient restart
output MUST include: 'Active: active (running) since ...'
If output lists '...active (exited)...' ddclient is NOT running as a daemon - reboot Ubuntu
- within 5 minutes (daemon_interval is in sec) Namecheap.com should list updated ip, and nslookup should resolve correctly