diff --git a/livedns.py b/livedns.py index 9eb9b6d..cc05137 100755 --- a/livedns.py +++ b/livedns.py @@ -60,15 +60,16 @@ def set_gandi_ip(addr, domain, hostname): # if this is a top domain (a-la kofemann.dev) then use '@' as a special placeholder for empty name if fqdn.find('.', dot + 1) == -1: - hostname = '@' + hostnames = [ '@', '*' ] domain = fqdn else: - hostname = fqdn[:dot] + hostnames = [ fqdn[:dot] ] domain = fqdn[dot+1:] try: - set_gandi_ip(ip, domain, hostname) - new_ip = get_gandi_ip(domain, hostname) + for hostname in hostnames: + set_gandi_ip(ip, domain, hostname) + new_ip = get_gandi_ip(domain, hostname) print('good') except urllib.error.HTTPError as e: if e.code == 401: