Multiple Domains with ddclient (Namecheap)

ddclient is an application that can automatically update your DNS hosting provider with your current IP address if you’re not lucky enough to have a broadband connection with a static IP. In short, it’s a Dynamic DNS client.

I myself started using ddclient a few years ago, but was never able to get it to work with multiple domain names. At the time, I’m not even sure it was possible. I ended up using someone’s custom script to update my secondary domain’s DNS records while using ddclient for my primary domain.

Well a few days ago, a DNS issue caused me to take another look at ddclient and wouldn’t you know, I was able to get both domains working without any patching or hacks. Since there’s still a lot of conflicting information out there, I decided to write my own article to help those that have similar setups.

In my case, I got it working using the latest version in Ubuntu’s repository which is ddclient 3.8.3. While I haven’t tested it, I believe this will also work with the latest release (3.9.0) as well.

How It’s Done

Assuming you’ve already installed ddclient, you’ll want to edit the ddclient config which will most likely be located in /etc/ddclient.conf.

sudo nano /etc/ddclient.conf

This is an example of a ddclient config with multiple domains and subdomains.

daemon=300
ssl=yes
use=web
web=dynamicdns.park-your-domain.com/getip
protocol=namecheap 
server=dynamicdns.park-your-domain.com

# First Domain
login=domainone.com
password=dynamicdnspassword
@.domainone.com, www.domainone.com, test.domainone.com

# Second Domain
login=domaintwo.com
password=dynamicdnspassword
@.domaintwo.com, www.domaintwo.com, mail.domaintwo.com, stuff.domaintwo.com

NOTE: I use Namecheap as my DNS hosting provider, but this should work with other supported DNS hosting providers as long as you change the protocol.

To get multiple domains to work with ddclient, you need to split out each domain into its own section with separate login credentials. You’ll also need to write out each hostname as its fully qualified domain name (FQDN).

For instance, if you wanted to add the subdomain www to the ddclient config, you would enter it as www.domainone.com instead of just www as stated in Namecheap’s documentation. To add the root domain, domainone.com, you’ll need to include @ in front of your domain name, i.e. @.domainone.com. Enter any subsequent domains in the same format.

Once you’ve finished adding your domains to the ddclient config, save and restart ddclient.

sudo systemctl restart ddclient

NOTE: If you’re on a distro that uses init.d, you can restart ddclient by running sudo /etc/init.d/ddclient restart

To make sure everything is working, manually change the IP address of an A record from each domain. If within 5 minutes, the IP changes back to your current Dynamic IP address, you’re good to go.


Share on Facebook
Facebook
Tweet about this on Twitter
Twitter
Share on LinkedIn
Linkedin
Share on Reddit
Reddit
Email this to someone
email
Print this page
Print

Please Share Me...I'm Lonely