Turns out we need to feed the IP of the resolver and can't use the doman name :/

This commit is contained in:
Alexandre Aubin 2021-01-19 02:34:28 +01:00 committed by GitHub
parent e730085970
commit 8b05248ad4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -218,7 +218,13 @@ def dyndns_update(operation_logger, dyn_host="dyndns.yunohost.org", domain=None,
def resolve_domain(domain, rdtype): def resolve_domain(domain, rdtype):
ok, result = dig(domain, rdtype, resolvers=[dyn_host]) # FIXME make this work for IPv6-only hosts too..
ok, result = dig(dyn_host, "A")
dyn_host_ip = result[0] if ok == "ok" and len(result) else None
if not dyn_host_ip:
raise YunohostError("Failed to resolve %s" % dyn_host)
ok, result = dig(domain, rdtype, resolvers=[dyn_host_ip])
if ok == "ok": if ok == "ok":
return result[0] if len(result) else None return result[0] if len(result) else None
elif result[0] == "Timeout": elif result[0] == "Timeout":