You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* XXX: Possibly move this exception to each plugin */constchar*except[] = {
"[email protected]",
"[email protected]"
};
constchar*name=info->system->name;
size_ti, j;
intnonslookup=0;
/* Exceptions -- no name to lookup */for (i=0; i<NELEMS(except); i++) {
if (!strncmp(name, except[i], strlen(name))) {
nonslookup=1;
break;
}
}
// XXX: TODO better plugin identifiction herefor (j=0; j<info->alias_count; j++)
read_one(&info->alias[j], name, nonslookup);
My current implementation for Cloudflare round-robin suffers from this problem, too. When passing a cloudflare ID this code tries to nslookup it giving the error:
Failed resolving hostname MY_CLOUDFLARE_ID: Temporary failure in name resolution
and always forcing the update.
It is a small problem, it won't stop the update, but I would like to fix it anyways.
To the best of my understanding there are currently 2 workarounds in the code for this:
inside the read_one() function (a special handling for all.dnsomatic.com):
/* Exception for dnsomatic's special global hostname */if (nonslookup|| !strncmp(alias->name, "all.dnsomatic.com", sizeof(alias->name)))
return;
/* Try a DNS lookup of our last known IP#. */nslookup(alias);
My first question would be:
I'm missing something or this special handling for all.dnsomatic.com is totally unneeded? Couldn't it just be added to this array?
The text was updated successfully, but these errors were encountered:
Second: What about to add an optional function pointer in ddns_system_t:
constint*skip_nslookup;
which would
receive the hostname as an input argument; and
return a boolean telling if the nslookup should be skipped.
Of course, if the function pointer is null the default would be false.
This would allow us to remove the special handling and also to solve my problem with Cloudflare round-robin entries.
All that said, I understand this is a very specific hook for a very specific situation being added to an entire plugin system. This is just my first idea. Any other suggestions to solve this problem are welcome.
You're right, this looks like a mess currently. I'm not so sure about the collapsing all.dnsomatic.com into that array though. The first is per provider and the latter is an exception for when a user selects updating all their dns entries for the given provider. (But then again, I'm still a bit off due to this flu I'm dragging along, and I've just woken up :)
Anyway, I think your proposal is a good one. The code needs a bit of refactoring, so please go ahead!
When implementing #454 I found another problem which I left to solve later.
It is related to this code in
cache.c
:My current implementation for Cloudflare round-robin suffers from this problem, too. When passing a cloudflare ID this code tries to
nslookup
it giving the error:and always forcing the update.
It is a small problem, it won't stop the update, but I would like to fix it anyways.
To the best of my understanding there are currently 2 workarounds in the code for this:
read_one()
function (a special handling forall.dnsomatic.com
):My first question would be:
I'm missing something or this special handling for
all.dnsomatic.com
is totally unneeded? Couldn't it just be added to this array?The text was updated successfully, but these errors were encountered: