coppit

Container for Duck DNS dynamic dns updates

Recommended Posts

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.

Share this post


Link to post
Share on other sites

Easy enough to configure, seems to be working fine on my end.  As rarely as my IP changes, wonder if I should change the interval to something higher?

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

I got it up and running, but instead of "OK" im getting "KO"

 

should i be worried about this

 

Getting the same thing. KO. It does not appear to be updating my IP. I rechecked my domain information mulitple times and it's all correct.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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. 

Share this post


Link to post
Share on other sites

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:

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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. ;)

Share this post


Link to post
Share on other sites

you could also just use native cron for duckdns and others like noip.

Check the install page for duckdns.  There is a simple example for "linux cron".

Share this post


Link to post
Share on other sites

you could also just use native cron for duckdns and others like noip.

Check the install page for duckdns.  There is a simple example for "linux cron".

 

Where's the fun in that?  ;D

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

No offense taken. For some reason I didn't get notifications for changes on this thread.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Copyright © 2005-2017 Lime Technology, Inc. unRAID® is a registered trademark of Lime Technology, Inc.