Sign inSign up

eidansoft/namecheap-ddns-update

By eidansoft

•Updated over 6 years ago

Update your domain as soon as your external IP has changed.

Image
0

50K+

eidansoft/namecheap-ddns-update repository overview

⁠Namecheap DDNS Update Docker container

The idea is to have a docker container to be able to run it into your server (laptop, VPS, RaspberryPi, etc), updating your NameCheap hosted domain as soon as it detects the IP has changed. I have completely rewrite the code for this image in order to make it more easy to understand, modify or update. The main change is that now when you call it, it will only run once, returning you the proper exit code (0 success, or other in error), with this change now I can easely manage the results notifying me if there is errors or when my IP changes.

If you desire the previous daemon behaviour that was continuously updating the IP when it change, please take a look at the eidansoft/namecheap-ddns-update-daemon⁠

⁠Run

To execute a single update of your domain just run the below command. This command will exit with the proper value in order let you know if the operation finished successfully or not (0 = success, otherwise fails). Also you will get a proper description of the error found:

docker run -it --rm -e DOMAIN="YOUR_DOMAIN" -e HOST="HOST_NAME" -e PASSWORD='THE_PASSWORD' eidansoft/namecheap-ddns-update

⁠Environment Variables

Below you will find the variables you can set to the container in order to get it work with your configuration:

  • DOMAIN string - name of domain to update. Example: lorente.info
  • PASSWORD string - the password given from NameCheap.com --> My Account --> Manage Domains --> Modify Domain --> Dynamic DNS. Example: Eu32UEuoAOEUeuiAIPIeui33i34i3ED33nth
  • HOST string - the host you wanna be updated.
  • FORCE bool - by default the code will only update the IP in case it has changed since latest update. If you set this param to true then it will update it always, no matter if it's the same one than on previous call. In order this work you should also use a named volume in order to store the previous IP. You can easely do that just adding the param -v $PWD/current-ip.txt:/opt/current-ip.txt.

⁠Troubleshouting

Basically the job is simply make a call to the NameCheap Update service URL, you can easely mimic it with a curl:

$ curl 'https://dynamicdns.park-your-domain.com/update?domain=YOUR_DOMAIN_NAME&password=YOUR_PW&host=THE_HOST_NAME_TO_UPDATE'

There are two possible responses from the service, the success one:

<?xml version="1.0"?><interface-response><Command>SETDNSHOST</Command><Language>eng</Language><IP>123.123.123.123</IP><ErrCount>0</ErrCount><ResponseCount>0</ResponseCount><Done>true</Done><debug><![CDATA[]]></debug></interface-response>

And the error one with a brief description of the error:

<?xml version="1.0"?><interface-response><Command>SETDNSHOST</Command><Language>eng</Language><ErrCount>1</ErrCount><errors><Err1>Passwords do not match</Err1></errors><ResponseCount>1</ResponseCount><responses><response><ResponseNumber>123456</ResponseNumber><ResponseString>Validation error; invalid ; password</ResponseString></response></responses><Done>true</Done><debug><![CDATA[]]></debug></interface-response>

Tag summary

Content type

Image

Digest

Size

4.5 MB

Last updated

over 6 years ago

docker pull eidansoft/namecheap-ddns-update