Closed clevernyyyy closed 4 years ago
This was pointed out to me. I think we should just reverse this if possible. https://github.com/oznu/docker-cloudflare-ddns/pull/21/commits
What is the behavior? Why doesn't the fallback work?
It times out, see open issue.
So it would seem that the fallback mechanism needs fixed. Otherwise what's the point of having it?
That is certainly one option, yes. I think I would prefer not wasting the cycles before falling back.
I have no context why the fall back mechanism was put in place. Reversing the change to cloud flare fixes my issue. I didn't have reason to reverse the fallback, so I did not.
One might also play around with dig
's timeout and tries option/tries and use both 1.1.1.1 and opendns.
+time=T Sets the timeout for a query to T seconds. The default timeout is 5 seconds. An attempt to set T to less than 1 will result in a query timeout of 1 second being applied.
+tries=T Sets the number of times to try UDP queries to server to T instead of the default, 3. If T is less than or equal to zero, the number of tries is silently rounded up to 1.
I have added a ternary statement. Regardless of dig
's timeout and tries operations, everything halted with the timeout output. However, I did take @ptts suggestion and just use both since everyone seems adamant to keep the cloudflare dns in regardless of the extra time it causes people in my predicament.
This new commit is a ternary statement which will utilize myip.opendns
if people's ISPs block 1.1.1.1
like mine does.
Pulling this in for testing.
@oznu - if you prefer a one-liner with grep
to the ternary, there's also this option:
( dig +short @1.1.1.1 ch txt whoami.cloudflare || dig +short myip.opendns.com @resolver1.opendns.com ) | tr -d '"' | grep -vF ';; connection timed out;'
I pushed a small fix to your PR to test. Can you confirm it's still working? It's published using the test
tag.
docker pull oznu/cloudflare-ddns:test
@oznu - it works!
Thanks @clevernyyyy. The latest tag will be updated shortly.
CenturyLink doesn't allow use of 1.1.1.1 for IP addr retrieval. Proposed change in order to work with my provider.