namecheap dynamic dns


Our new house isn't in an area with a decent internet service provider, so I can't get a static IP address for my home server. To maintain access with my home datastore I turned to Dynamic DNS. Fortunately for me my domain name was registered with namecheap which provides free dynamic dns service to their customers.

I went the 'non-standard' approach and setup a dynamic dns updater on my home linux server.

References

About DDClient

DDClient is a dynamic dns updater written in perl that runs on *NIX platforms (and probably other places that have a decent perl interpreter). If you use your favorite text editor to examine the perl source, you will find that it supports a broad range of devices and web services, which is pretty darn awesome. Fortunately for me, namecheap is available as a supported service.

It can be kind of difficult to figure out how to setup a ddclient.conf file even after looking over the namecheap and other documentation. Apparently there are a few different modes which the script can use to determine IP Address. I'll paste my configuration file below and describe what each line does, as that is the best I can do without writing a ton of doc. :)

 

My DDClient setup

I extracted the tarball and had to manually set it up:

  1. Extracted the script to /opt/ddclient (Not required, you can place it just about anywhere)
  2. Had to manually create a /var/cache/ddclient directory (It was not clear that this was required)
  3. Had to manually create a /etc/ddclient/ddclient.conf file (Location of this file was not made clear)

After getting it all setup, I created a crontab job to run the updater every 30 minutes. While ddclient has a daemon mode to do this automagically, I trust crontab a bit more.

 

Sample NameCheap DDClient.conf File:

Here is the file I setup:

use=web
verbose=yes
web=www.checkip.net/?IP, web-skip='Current-IP-Address:'
protocol=namecheap
server=dynamicdns.park-your-domain.com
login=my-domain-registered-through-namecheap.net
password=48be09aaa53c12bd79b6cd5a4cd2adda7
mail

 

And for the breakdown of what each line means:

  • use=web
    • This line indicates that ddclient will use a web service to determine the client's IP address
       
  • verbose=yes
    • If verbose is set to yes you will see a lot of output to the console, which can be useful for debugging purposes
       
  • web=www.checkip.net/?IP, web-skip='Current-IP-Address:'
    • This web= line sets up the webservice that will be used to determine the client's IP address. I found this from a forum somewhere
       
  • protocol=namecheap
    • Since ddclient supports a metric tonne of different dynamic DNS Services, you can specify which service you use with the protocol= line
       
  • server=dynamicdns.park-your-domain.com
    • The namecheap support document indicates that this server= line is required for things to work correctly.

  • login=my-domain-registered-through-namecheap.net
    • The login= line should point to the domain name you have registered through namecheap

  • password=48be09aaa53c12bd79b6cd5a4cd2adda7
    • This is the password that you get after enabling dynamic DNS through the namecheap portal

  • mail
    • Specify the subdomain you want dynamic DNS to apply to. This must be an A record
 

Happy Dynamic DNS-ing!