Troubleshooting Dynamic DNS

If your problem doesn't fall into one of the other categories, report it here.

Moderator: Moderators

Post Reply
oliver
Posts: 48
Joined: Wed Jun 04, 2014 7:30 pm

Troubleshooting Dynamic DNS

Post by oliver »

Running 1.11.0 on TL-WDR3600 v1

I have a dynamic domain at afraid.org but I can't successfully add it to the DDNS service. How do I effectively troubleshoot?

The paragraph in /etc/ddns_providers.conf was set to:

Code: Select all

service freedns.afraid.org
        url_template                    [[META_URL]]
        required_variables              domain username password
        required_variable_names         DyDNS.DoNm,DyDNS.UsrN,DyDNS.Pssw
        success_regexp                  /(^Updated|has not changed.)/
        meta_variables                  meta_url
        meta_variables_to_cache         meta_url
        meta_url                        ewget -O -  "https://freedns.afraid.org/api/?action=getdyndns&sha="$(printf "[[USERNAME]]|[[PASSWORD]]" | sha1sum | awk ' { print $1 }') 2>/dev/null |
grep "[[DOMAIN]]" | sed 's/^.*|//g'
but it looks like they've switched to a token method (and the token is not an sha1sum of [[USERNAME]]|[[PASSWORD]] - and a secondary issue is that my password has a % in it which throws off printf)

I changed the paragraph to this

Code: Select all

service freedns.afraid.org
        url_template                    [[META_URL]]
        required_variables              domain token
        required_variable_names         DyDNS.DoNm,DyDNS.Tokn
        success_regexp                  /(Updated|has not changed)/
        meta_variables                  meta_url
        meta_url                        ewget -O - "https://freedns.afraid.org/dynamic/update.php?[[TOKEN]]" 2>/dev/null
If I literally put my token at the end, I get this (the x's are to obfuscate):

Code: Select all

root@Gargoyle:/etc#  ewget -O - "https://freedns.afraid.org/dynamic/update.php?d3VExxxxxxxxxxxxxZE86MTg2OTkwMjQ=" 2>/dev/null
ERROR: Address 73.237.xx.xx has not changed.
So it seems like success_regexp should match but when run thru the GUI I get a "Update of new dynamic DNS service configuration(s) failed:" pop-up

I have another DDNS entry at ddns.org and that is working so I know the pkg is good.

What am I missing and can I somehow get logs from the ddns pkg?

Regarding the % in password thing I mentioned earlier, printf needs the % escaped with another %

No escape

Code: Select all

root@Gargoyle:/etc# printf "username|%qwerty" | sha1sum
ash: %qwerty: invalid format
14cc980b41e487e479b57166fcb3e206fa2672d9  -
Escaped

Code: Select all

root@Gargoyle:/etc# printf "username|%%qwerty" | sha1sum
6f4e7c015cd3d9ff2ca56e73d8ad0966d82e13c4  -
And escaped version matches echo -n

Code: Select all

root@Gargoyle:/etc# echo -n "username|%qwerty" | sha1sum
6f4e7c015cd3d9ff2ca56e73d8ad0966d82e13c4  -

Lantis
Moderator
Posts: 6753
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Troubleshooting Dynamic DNS

Post by Lantis »

For a simple URL like that, don't use meta url. Just place it directly in the url_template.
Thanks for pointing out the updated API, I'll look at it shortly.
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

oliver
Posts: 48
Joined: Wed Jun 04, 2014 7:30 pm

Re: Troubleshooting Dynamic DNS

Post by oliver »

Lantis wrote:For a simple URL like that, don't use meta url. Just place it directly in the url_template.
Thanks for pointing out the updated API, I'll look at it shortly.
Thanks... that did the trick. New paragraph is:

Code: Select all

service freedns.afraid.org
        url_template                    https://freedns.afraid.org/dynamic/update.php?[[TOKEN]]
        required_variables              domain token
        required_variable_names         DyDNS.DoNm,DyDNS.Tokn
        success_regexp                  /(Updated|has not changed)/
I have no idea how they generate that token though but they do give the option to rotate it if you think it's been compromised so I suspect it's not just username/password.

I got it from the "direct URL" link on the ddns page when you log into afraid.org

Lantis
Moderator
Posts: 6753
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Troubleshooting Dynamic DNS

Post by Lantis »

Yea had a quick look. They still support the old username password domain and ip format, but the URL has changed.
I'll probably stick to that unless I can find out how the token system works.
I'm concerned from a usability point of view that the token isn't meaningful. You can't look at it and understand what domain it pertains to directly.
I also don't know if each domain has it's own token, or whether it updated them all together.

Will see :)
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

Lantis
Moderator
Posts: 6753
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Troubleshooting Dynamic DNS

Post by Lantis »

The old URL was still working for me.
I don't know that it really needs an update...
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

oliver
Posts: 48
Joined: Wed Jun 04, 2014 7:30 pm

Re: Troubleshooting Dynamic DNS

Post by oliver »

Lantis wrote:The old URL was still working for me.
I don't know that it really needs an update...
I just tested again and the old version works for me too but only after I change my password to one without '%' in it. Didn't test any other special characters.

I was wondering if the unescaped_variables setting would take care of that but maybe that only looks at the URL after the printf part is evaluated?

Lantis
Moderator
Posts: 6753
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Troubleshooting Dynamic DNS

Post by Lantis »

http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

oliver
Posts: 48
Joined: Wed Jun 04, 2014 7:30 pm

Re: Troubleshooting Dynamic DNS

Post by oliver »

Lantis wrote:Thanks, i've pushed a fix now.
https://github.com/ericpaulbishop/gargo ... d9dc4aac36
Nice - thanks!

Post Reply