ddclient to update namecheap subdomain?

I have a subdomain that I want to update with ddclient. I configured the ddclient to get the IP from dyndns but it's not updating the subdomain on namecheap. They said to use yourdomain.com as the login instead of my actual domain.

Has anyone been able to get namecheap DNS updated with ddclient?

I'm running CentOS 6.2 with ddclient 3.7.3.

When I run ddclient I get the following.

CONNECT:  checkip.dyndns.org
CONNECTED:  using HTTP
SENDING:  GET / HTTP/1.0
SENDING:   Host: checkip.dyndns.org
SENDING:   User-Agent: ddclient/3.7.3
SENDING:   Connection: close
SENDING:
RECEIVE:  HTTP/1.1 200 OK
RECEIVE:  Content-Type: text/html
RECEIVE:  Server: DynDNS-CheckIP/1.0
RECEIVE:  Connection: close
RECEIVE:  Cache-Control: no-cache
RECEIVE:  Pragma: no-cache
RECEIVE:  Content-Length: 106
RECEIVE:
RECEIVE:  <html><head><title>Current IP Check</title></head><body>Current IP Address: IPADD</body></html>
Use of uninitialized value in string ne at /usr/sbin/ddclient line 1998.
WARNING:  skipping update of lf4bot from <nothing> to IPADD
WARNING:   last updated <never> but last attempt on Fri Jun 15 22:46:21 2012 failed.
WARNING:   Wait at least 5 minutes between update attempts.

ddclient.conf File

daemon=300                              # check every 300 seconds
syslog=yes                              # log update msgs to syslog
mail=root                               # mail all msgs to root
mail-failure=root                       # mail failed update msgs to root
pid=/var/run/ddclient.pid               # record PID in file.
ssl=yes                                 # use ssl-support.  Works with
use=web, web=checkip.dyndns.org/, web-skip='IP Address' # found after IP Address
protocol=namecheap \
server=dynamicdns.park-your-domain.com \
login=yourdomain.com \
password=PASSWORD \
lf4bot

Solution 1:

I just went through this process, and want to note some issues that tripped me up.

First, this is the canonical reference for configuring ddns for namecheap: http://www.namecheap.com/support/knowledgebase/article.aspx/583/11/how-to-configure-ddclient

If you don't want to rely on an external web service for finding your IP (like me), things are slightly more complicated. ddclient has a facility for logging into your router and grabbing your IP address from there, which should be the most efficient and reliable method.

The first thing you need is to find the page that contains your IP address. For me, this was http://192.168.1.1/RST_status.htm. Make sure that when you "view source" on that page, you see your IP address. Now log out of your router, otherwise ddclient will just see an error message about how someone is already logged in. Finally edit your /etc/ddclient.conf like so:

protocol=namecheap
use=fw
fw=192.168.1.1/RST_status.htm
fw-login=admin
fw-password=<my-router-password>
server=dynamicdns.park-your-domain.com
login=<my-domain>.org
password='<8cc67226fadff52f402d31505ee85d6b>'
www

To make sure it works, run: ddclient --debug --verbose. You should see the webpage that it downloads from the router, and the IP that it scrapes out of it.

You probably don't want to use the --noexec option for debugging, since ddclient will then skip downloading html from the router, and won't find any IP address. In that case you will see DEBUG: skipped network connection and WARNING: unable to determine IP address, which is no good.

Solution 2:

I was using ddclient version 3.7.3 on centos 6.2 I don't know if the versions matter but the way I ended up setting up my namecheap dyndns was this way. I made it so others could see exactly how they should have it just replace the google.com, 8cc67226fadff52f402d31505ee85d6b and dev with your setup.

Don't add quotes around the password or add commas/backslashes after each line.

##
## NameCheap (namecheap.com)
##
protocol=namecheap
server=dynamicdns.park-your-domain.com
login=google.com
password=8cc67226fadff52f402d31505ee85d6b
dev