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

Don't try to resolve all.dnsomatic.com if set as hostname #216

Closed
RMerl opened this issue Sep 26, 2018 · 3 comments
Closed

Don't try to resolve all.dnsomatic.com if set as hostname #216

RMerl opened this issue Sep 26, 2018 · 3 comments

Comments

@RMerl
Copy link
Contributor

RMerl commented Sep 26, 2018

Dnsomatic allows the use of the special "all.dnsomatic.com" hostname to instruct dnsomatic to update all supported hostname (in addition to the option of providing an empty hostname).

Reference: https://dnsomatic.com/wiki/faq (see "How do I update all my DNS-O-Matic services at once?")

I recommend implementing an exception (similar to what is being done for HE's tunnel) for that (non-resolvable) host to avoid generating an error message.

--- a/release/src/router/inadyn/src/cache.c
+++ b/release/src/router/inadyn/src/cache.c
@@ -85,7 +85,8 @@ static void read_one(ddns_alias_t *alias, int nonslookup)
        cache_file(alias->name, path, sizeof(path));
        fp = fopen(path, "r");
        if (!fp) {
-               if (nonslookup)
+               /* Exception for dnsomatic's special global hostname */
+               if (nonslookup || !strcmp(alias->address, "all.dnsomatic.com"))
                        return;
 
                /* Try a DNS lookup of our last known IP#. */

Not sure if this is the best way to implement this however, I haven't extensively studied the caching code.

@troglobit
Copy link
Owner

If the fix works, I'd very much appreciate a pull request! (A new release will be out very soon, so if you make a PR it will get merged :)

Sure the code can be made more generic, for other plugins to hook into, but no point to over-engineer it beforehand.

@RMerl
Copy link
Contributor Author

RMerl commented Sep 26, 2018

I'll try to get a pull request done before the weekend (I first need to test the change myself in my own code base).

@RMerl
Copy link
Contributor Author

RMerl commented Sep 26, 2018

The above patch doesn't work as-is, I still get "Failed resolving hostname all.dnsomatic.com" in the system log. I will need to do some digging to see if I missed another nslookup call somewhere else.

EDIT: my bad, I should be checking alias->name, not alias->address.

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

2 participants