diff --git a/certbot_dns_duckdns/__init__.py b/certbot_dns_duckdns/__init__.py index 4fa30d2..ea6383d 100644 --- a/certbot_dns_duckdns/__init__.py +++ b/certbot_dns_duckdns/__init__.py @@ -1,3 +1,3 @@ """Certbot plugin for DNS-01 challenge using DuckDNS.""" -__version__ = "v1.7.0" +__version__ = "v1.7.1" diff --git a/certbot_dns_duckdns/cert/client.py b/certbot_dns_duckdns/cert/client.py index 58083e6..8c59d48 100644 --- a/certbot_dns_duckdns/cert/client.py +++ b/certbot_dns_duckdns/cert/client.py @@ -118,15 +118,17 @@ def _perform(self, domain: str, validation_name: str, validation: str) -> None: txt_values = custom_resolver.resolve(duckdns_domain, "TXT") else: txt_values = custom_resolver.query(duckdns_domain, "TXT") - except Exception as e: - raise errors.PluginError(e) - # there should only be one single TXT record - if len(txt_values) != 1: - raise errors.PluginError("issue resoling TXT record") + # there should only be one single TXT record + if len(txt_values) != 1: + raise errors.PluginError("issue resoling TXT record") - # remove the additional quotes around the TXT value - self._old_txt_value = txt_values[0].to_text()[1:-1] + # remove the additional quotes around the TXT value + self._old_txt_value = txt_values[0].to_text()[1:-1] + except dns.resolver.NoAnswer: + self._old_txt_value = "" + except Exception as e: + raise errors.PluginError(e) try: self._get_duckdns_client().set_txt_record(duckdns_domain, validation)