From 8b05248ad45bfe05ae9205e976798a4e722eaee9 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 19 Jan 2021 02:34:28 +0100 Subject: [PATCH] Turns out we need to feed the IP of the resolver and can't use the doman name :/ --- src/yunohost/dyndns.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/yunohost/dyndns.py b/src/yunohost/dyndns.py index 84b55d40e..9904d3955 100644 --- a/src/yunohost/dyndns.py +++ b/src/yunohost/dyndns.py @@ -218,7 +218,13 @@ def dyndns_update(operation_logger, dyn_host="dyndns.yunohost.org", domain=None, 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": return result[0] if len(result) else None elif result[0] == "Timeout":