Skip to content

Instantly share code, notes, and snippets.

@Zebiano
Last active June 22, 2023 22:45
Show Gist options
  • Save Zebiano/911f1f23befffbe908e59c4113b4913d to your computer and use it in GitHub Desktop.
Save Zebiano/911f1f23befffbe908e59c4113b4913d to your computer and use it in GitHub Desktop.
DDClient systemd service setup with Namecheap

DDClient setup

Warning: I believe the paths to be outdated, as DDClient docs point to /etc/ddclient/ddclient.conf instead of /etc/ddclient.conf. However, this document should still work regardless.

Quick and easy steps to get DDClient running with Namecheap and as a systemd service on Ubuntu Server OS.

Installation

Use apt to easily install ddclient:

sudo apt install ddclient

When prompted with a GUI to configure ddclient, feel free to either fill in information correctly, or to simply skip it and configure it in a later step. You will have to configure it manually anyways though.

Configuration

You'll first have to enable "Dynamic DNS" on Namecheap to get a password.

In order to configure ddclient to work with Namecheap, run sudo nano /etc/ddclient.conf and make sure these Namecheap settings are applied:

use=web, web=dynamicdns.park-your-domain.com/getip
protocol=namecheap
server=dynamicdns.park-your-domain.com
login=YOUR_DOMAIN.COM
password=YOUR_PASSWORD
YOUR_HOST_1,YOUR_HOST_2,YOUR_HOST_3

Check if it works

Verify your configuration is correctly set up:

sudo ddclient -daemon=0 -verbose

You should get something like:

ubuntu@ubuntu:~$ sudo ddclient -daemon=0 -verbose
CONNECT:  dynamicdns.park-your-domain.com
CONNECTED:  using HTTP
SENDING:  GET /getip HTTP/1.0
SENDING:   Host: dynamicdns.park-your-domain.com
SENDING:   User-Agent: ddclient/3.9.1
SENDING:   Connection: close
SENDING:   
SENDING:   
RECEIVE:  HTTP/1.1 200 OK
RECEIVE:  Date: Mon, 25 Jul 2022 11:44:27 GMT
RECEIVE:  Content-Type: text/html
RECEIVE:  Connection: close
RECEIVE:  CF-Cache-Status: DYNAMIC
RECEIVE:  Server: cloudflare
RECEIVE:  
RECEIVE:  123.123.123.123
SUCCESS:  YOUR_HOST_1: skipped: IP address was already set to 123.123.123.123.
SUCCESS:  YOUR_HOST_2: skipped: IP address was already set to 123.123.123.123.
SUCCESS:  YOUR_HOST_3: skipped: IP address was already set to 123.123.123.123.

Run ddclient as a service

In order to get ddclient to start on system boot, you need to run it as a systemd service:

sudo systemctl enable ddclient.service
sudo systemctl start ddclient.service

Information taken from this Gist (which seems to be invalid last time I checked), there's some troubleshooting help there which may be useful if you're running into errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment