Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

split problem dns_freedns.sh #1086

Open
rbijos opened this issue Oct 26, 2017 · 10 comments
Open

split problem dns_freedns.sh #1086

rbijos opened this issue Oct 26, 2017 · 10 comments

Comments

@rbijos
Copy link

rbijos commented Oct 26, 2017

Hello!
The split part of the script caused me trouble.
In this part

(hashtag) split our full domain name into two parts...
i="$(echo "$fulldomain" | tr '.' ' ' | wc -w)"
i="$(_math "$i" - 1)"
top_domain="$(echo "$fulldomain" | cut -d. -f "$i"-100)"
i="$(_math "$i" - 1)"
sub_domain="$(echo "$fulldomain" | cut -d. -f -"$i")"

it was not trimming my domain right.
I have a subdomain.domain.tld.cc (cc=country code)
It was trimming as subdomain.domain tld.cc
A workaround in my case was to put 2 for the first 1.
it worked as should subdomain domain.tld.cc

It should be another way to trim or to put a var to specify the domain or a documentation.
Thanks

@mcgr0g
Copy link

mcgr0g commented Mar 11, 2018

guy, just read this one http://freedns.afraid.org/dynamic/ and ready copy curl script with your AUTH token to your router.

@pisaman2
Copy link

pisaman2 commented May 5, 2018

Yep I'm having a similar problem with a .co.uk domain

I'm gonna try changing the 1 to 2 now and see how that works

frebib added a commit to frebib/acme.sh that referenced this issue Aug 21, 2018
Fixes acmesh-official#1086
Supercedes acmesh-official#1454

Signed-off-by: Joe Groocock <me@frebib.net>
frebib added a commit to frebib/acme.sh that referenced this issue Aug 21, 2018
Fixes acmesh-official#1086
Supercedes acmesh-official#1454

Signed-off-by: Joe Groocock <me@frebib.net>
@felixgonsug
Copy link

How did you solve this?

@felixgonsug
Copy link

I manage to change the 1 for the 2 and int worked, thanks.

@dkerr64
Copy link
Contributor

dkerr64 commented May 23, 2019

@rbijos can you please test the freedns api script here... https://raw.githubusercontent.com/dkerr64/acme.sh/FreeDNS/dnsapi/dns_freedns.sh

@dkerr64
Copy link
Contributor

dkerr64 commented May 23, 2019

PR #2285 opened.

@rbijos
Copy link
Author

rbijos commented May 23, 2019

@rbijos can you please test the freedns api script here... https://raw.githubusercontent.com/dkerr64/acme.sh/FreeDNS/dnsapi/dns_freedns.sh

It worked after the first time I tried, on a total of 6 tries on 3 different domains (I think the error was on the server not the script). I tried both domain.tld.cc and domain.tld.

First try error log. (only the error part, domain name changed to test). TXT records have been created correctly at freedns.
[qui mai 23 07:20:04 -03 2019] All success, let's return
[qui mai 23 07:20:04 -03 2019] ok, let's start to verify
[qui mai 23 07:20:04 -03 2019] Verifying: test.adv.br
[qui mai 23 07:20:04 -03 2019] d='test.adv.br'
[qui mai 23 07:20:04 -03 2019] keyauthorization='-F9WRato6lWnQaoczWyOHucAY8cRbGTXyZfytdBSI3U.VeJpEGJ4w6fUJyPItS5iC_VmjEFgiy5oFxwcbSLW3kk'
[qui mai 23 07:20:04 -03 2019] uri='https://acme-staging-v02.api.letsencrypt.org/acme/challenge/b0nkZZ6ccuJJYK-DrlGddi5zcQ1Lv0c_eDg6qIXCByY/314197782'
[qui mai 23 07:20:04 -03 2019] _currentRoot='dns_freedns'
[qui mai 23 07:20:04 -03 2019] url='https://acme-staging-v02.api.letsencrypt.org/acme/challenge/b0nkZZ6ccuJJYK-DrlGddi5zcQ1Lv0c_eDg6qIXCByY/314197782'
[qui mai 23 07:20:04 -03 2019] payload='{}'
[qui mai 23 07:20:05 -03 2019] POST
[qui mai 23 07:20:05 -03 2019] _post_url='https://acme-staging-v02.api.letsencrypt.org/acme/challenge/b0nkZZ6ccuJJYK-DrlGddi5zcQ1Lv0c_eDg6qIXCByY/314197782'
[qui mai 23 07:20:05 -03 2019] _CURL='curl -L --silent --dump-header /home/rbf/.acme.sh/http.header -g '
[qui mai 23 07:20:05 -03 2019] _ret='0'
[qui mai 23 07:20:05 -03 2019] code='200'
[qui mai 23 07:20:05 -03 2019] trigger validation code: 200
[qui mai 23 07:20:05 -03 2019] sleep 2 secs to verify
[qui mai 23 07:20:07 -03 2019] checking
[qui mai 23 07:20:07 -03 2019] url='https://acme-staging-v02.api.letsencrypt.org/acme/challenge/b0nkZZ6ccuJJYK-DrlGddi5zcQ1Lv0c_eDg6qIXCByY/314197782'
[qui mai 23 07:20:07 -03 2019] payload
[qui mai 23 07:20:07 -03 2019] POST
[qui mai 23 07:20:07 -03 2019] _post_url='https://acme-staging-v02.api.letsencrypt.org/acme/challenge/b0nkZZ6ccuJJYK-DrlGddi5zcQ1Lv0c_eDg6qIXCByY/314197782'
[qui mai 23 07:20:07 -03 2019] _CURL='curl -L --silent --dump-header /home/rbf/.acme.sh/http.header -g '
[qui mai 23 07:20:07 -03 2019] _ret='0'
[qui mai 23 07:20:07 -03 2019] code='200'
[qui mai 23 07:20:07 -03 2019] test.adv.br:Verify error:DNS problem: NXDOMAIN looking up TXT for _acme-challenge.test.adv.br
[qui mai 23 07:20:07 -03 2019] Skip for removelevel:
[qui mai 23 07:20:07 -03 2019] pid
[qui mai 23 07:20:07 -03 2019] No need to restore nginx, skip.
[qui mai 23 07:20:07 -03 2019] _clearupdns
[qui mai 23 07:20:07 -03 2019] dns_entries='test.adv.br,_acme-challenge.test.adv.br,,dns_freedns,LFUCK9Wa6fYCtzABuS_z_wyVuAjh6lmmby-hK4Ef8QA,/home/rbf/.acme.sh/dnsap i/dns_freedns.sh
test.adv.br,_acme-challenge.test.adv.br,,dns_freedns,AHH0c0nQy66MK3WCVPjgBHRK9L4A-bV2lgKR402QtJw,/home/rbf/.acme.sh/dnsapi/dns_freedns.sh

@dkerr64
Copy link
Contributor

dkerr64 commented May 23, 2019

@rbijos I don't think your problem is related to the FreeDNS script. Did you only allow 2 seconds for the TXT record to propagate? That is very short time and the error msg suggests that it did not propagate. Can you confirm the the TXT record was also deleted after the failure to validate?
Thanks

@rbijos
Copy link
Author

rbijos commented May 23, 2019

@rbijos I don't think your problem is related to the FreeDNS script. Did you only allow 2 seconds for the TXT record to propagate? That is very short time and the error msg suggests that it did not propagate. Can you confirm the the TXT record was also deleted after the failure to validate?
Thanks

Can you confirm the the TXT record was also deleted after the failure to validate?

Yes, was deleted.

The "two seconds" in this case, I think, is to check the challenge response. I didn't changed any sleep time configuration. On my script it wait for 20 seconds and check every 10 seconds.
[qui mai 23 07:17:54 -03 2019] Adding TXT record for _acme-challenge.test.adv.br, AHH0c0nQy66MK3WCVPjgBHRK9L4A-bV2lgKR402QtJw
[qui mai 23 07:17:54 -03 2019] POST
[qui mai 23 07:17:54 -03 2019] _post_url='https://freedns.afraid.org/subdomain/save.php?step=2'
[qui mai 23 07:17:54 -03 2019] _CURL='curl -L --silent --dump-header /home/rbf/.acme.sh/http.header -g '
[qui mai 23 07:17:55 -03 2019] _ret='0'
[qui mai 23 07:17:55 -03 2019] Added acme challenge TXT record for _acme-challenge.test.adv.br at FreeDNS
[qui mai 23 07:17:55 -03 2019] Let's check each dns records now. Sleep 20 seconds first.
[qui mai 23 07:18:16 -03 2019] d='test.adv.br'
[qui mai 23 07:18:16 -03 2019] txtdomain='_acme-challenge.test.adv.br'
[qui mai 23 07:18:16 -03 2019] aliasDomain='_acme-challenge.test.adv.br'
[qui mai 23 07:18:16 -03 2019] txt='LFUCK9Wa6fYCtzABuS_z_wyVuAjh6lmmby-hK4Ef8QA'
[qui mai 23 07:18:16 -03 2019] d_api='/home/rbf/.acme.sh/dnsapi/dns_freedns.sh'
[qui mai 23 07:18:16 -03 2019] Checking test.adv.br for _acme-challenge.test.adv.br
[qui mai 23 07:18:16 -03 2019] _c_txtdomain='_acme-challenge.test.adv.br'
[qui mai 23 07:18:16 -03 2019] _c_aliasdomain='_acme-challenge.test.adv.br'
[qui mai 23 07:18:16 -03 2019] _c_txt='LFUCK9Wa6fYCtzABuS_z_wyVuAjh6lmmby-hK4Ef8QA'
[qui mai 23 07:18:16 -03 2019] GET
[qui mai 23 07:18:16 -03 2019] url='https://cloudflare-dns.com/dns-query?name=_acme-challenge.test.adv.br&type=TXT'
[qui mai 23 07:18:16 -03 2019] timeout=
[qui mai 23 07:18:16 -03 2019] _CURL='curl -L --silent --dump-header /home/rbf/.acme.sh/http.header -g '
[qui mai 23 07:18:21 -03 2019] ret='0'
[qui mai 23 07:18:21 -03 2019] Not valid yet, let's wait 10 seconds and check next one.

@dkerr64
Copy link
Contributor

dkerr64 commented May 23, 2019

So, given the TXT record is deleted then the dns_freedns.sh script is working as intended. You must allow enough time for the DNS updates to propagate so that when letsencrypt queries it for validation the update is propagated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants