Container for Duck DNS dynamic dns updates


Recommended Posts

THIS CONTAINER IS NO LONGER SUPPORTED.

It works okay, but there is another one by linuxserver, and I don't want to create confusion in the "app marketplace".

 

My first Docker container!

 

https://registry.hub.docker.com/u/coppit/duckdns/

 

Like a lot of people, my ISP assigns a dynamic IP to my modem. After registering with Duck DNS (free), this container will keep my IP address up-to-date. You should be able to set it all up in 5 minutes. Just create your config file somewhere and drop the "docker run" command into your /boot/config/go.

Edited by coppit
Link to comment
  • 2 weeks later...

Wha??? KO? Knockout? I dunno. I guess assume it's working until proven otherwise. :) Maybe take a note of your current IP and check it again after a week or so. You could also try unplugging your cable modem or whatever and try to force it to get a new IP.

Link to comment

if it is KO check your Token and Domain is correct in the duck.sh script

 

By duck.sh script, do you mean the duck.conf file? If not, where would I find the script?

 

I just created a new domain and generated a new toke, updated the duck.conf file and restart the container with the same KO in the log.

Yes.  this docker calls it the duck.conf. 
Link to comment

Still no luck.  I tried running Docker logs for the container but, nothing shows up. Here's my sys log but, I'm not sure what it's showing me.

 

Sep  1 16:42:44 Tower php: DuckDNS

Sep  1 16:42:44 Tower php:

Sep  1 16:42:44 Tower avahi-daemon[2647]: Withdrawing workstation service for veth7cfa.

Sep  1 16:42:44 Tower kernel: docker0: port 4(veth7cfa) entered disabled state

Sep  1 16:42:44 Tower kernel: device veth7cfa left promiscuous mode

Sep  1 16:42:44 Tower kernel: docker0: port 4(veth7cfa) entered disabled state

Sep  1 16:43:13 Tower php: /usr/bin/docker start DuckDNS

Sep  1 16:43:14 Tower kernel: device veth8d1e entered promiscuous mode

Sep  1 16:43:14 Tower avahi-daemon[2647]: Withdrawing workstation service for veth16da.

Sep  1 16:43:14 Tower kernel: docker0: port 4(veth8d1e) entered forwarding state

Sep  1 16:43:14 Tower kernel: docker0: port 4(veth8d1e) entered forwarding state

Sep  1 16:43:14 Tower php: DuckDNS

Sep  1 16:43:14 Tower php:

Link to comment

I can't easily debug without a way to repro it, and I'd rather people not send me their credentials. :)

 

How about this: Run it this way:

docker run -i -v /config/dir/path:/config -t coppit/duckdns /bin/bash

 

Be sure to replace the config path with your path. Then run this:

sed -i 's/ | curl/ # | curl/' /root/duckdns/duck.sh
/root/duckdns/duck.sh

 

It should print out something like this:

url=https://www.duckdns.org/update?domains=coppit&token=2980238c-cd4a-4fed-f09b-db8291f9a194&ip=

 

Press CTRL-c to break the script, then CTRL-d to log out of the container.

 

Let me know how it goes.

Link to comment

I can't easily debug without a way to repro it, and I'd rather people not send me their credentials. :)

 

How about this: Run it this way:

docker run -i -v /config/dir/path:/config -t coppit/duckdns /bin/bash

 

Be sure to replace the config path with your path. Then run this:

sed -i 's/ | curl/ # | curl/' /root/duckdns/duck.sh
/root/duckdns/duck.sh

 

It should print out something like this:

url=https://www.duckdns.org/update?domains=coppit&token=2980238c-cd4a-4fed-f09b-db8291f9a194&ip=

 

Press CTRL-c to break the script, then CTRL-d to log out of the container.

 

Let me know how it goes.

 

Definitely not getting anything like that. I'm getting &ip=en=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxdomain.duckdns.org.

 

It is showing my actual token and domain, just not with anything else or in the correct format.

 

It's also not creating the log file now.

Link to comment

Okay, I think the problem is that your file had DOS line endings. I've updated the code to work around that. Please do:

docker pull coppit/duckdns

 

to get the latest version, and try again.

 

Interesting. On the plus side, I'm getting an OK in the log. On the weird side, the IP address that duckdns updates to is not my IP address. I rebooted my modem to make sure I had a new IP address, an the docker and then ran update IP on the duckdns site. It shows a successful update but it's not my IP. I tried recreating the container with no change.

 

I was going to try creating a new domain and then redoing the duck.conf file but, when when I created the new domain, the IP for my current domain updated also. It may have just been a weird delay on their side or who knows what.

 

At the end of the day, everything seems to be working now. Many thanks and great work.

 

Now I just need an openvpn server docker. ;)

Link to comment
  • 7 months later...

Thanks so much coppit

 

This is just what I needed.

 

Here's what I did to install this with the new docker tab in the webgui

 

On unraid

1. Create /path/to/duckdns

2. Create a file named duck.conf in there and define the variables as described on docker page

 

On the web gui / docker tab

1. Click on add container and switch to advanced view

2. Put in duckdns in the name field

3. For repository you can put in coppit/duckdns

4. Under Volume Mappings, add /config as container volume and /path/to/duckdns/ as host path

5. Under additional fields, put in https://registry.hub.docker.com/u/coppit/duckdns/ for the Docker Hub Url

6. Put in https://www.duckdns.org/favicon.ico as the Icon

7. Hit create and watch it built and run

7. Turn autostart on

8. Profit

Link to comment

OK,

 

I liked it so much, I took it one step further.I forked coppit's code and created a new docker, one that uses cron, and can be added from a repository.

 

 

To install, go to the unraid webgui's docker tab, enter the following under "Template Repositories" and hit save

 

https://github.com/aptalca/docker-templates

 

Then hit "Add Container" and select "duckdns" under the "Template" menu at the top

 

You just have to enter the "Host Path" for the config folder

You also have to create the duck.conf file with the domain and token variables

 

 

There are 2 main changes from coppit's original:

1) This one uses cron method for running the script (hardcoded at every 5 min per duckdns.org recommendation)

2) This one does not append an OK to the log every time the script runs. Instead, it posts the latest result along with a timestamp.

Link to comment

Sigh. Why do people fork instead of working together? If you want to maintain your own, which is better than mine, I'll kill my github repo and update the first post to refer to yours. Or I can make you a co-maintainer, or you can send me a pull request.

Link to comment

Didn't mean no offense, man.

 

I needed it for myself, was in a rush, and put it together. I figured others might benefit as well if I posted about it. That's why I didn't create a separate release thread, but instead let people know in here.

 

Your last post and commit on this was from 8 months ago. I honestly didn't think you were interested in continuing work since you didn't put it in a template repo and didn't answer the cron question.

 

If you are interested, I'd be happy to work with you. I can send you pull requests for the changes I made. Please let me know.

 

This was really more of a learning experience for me on docker and github repos.  ;)

 

Thanks

Link to comment
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.