From 1d1ba891f8ce83610a15d4af8141c99467fd0343 Mon Sep 17 00:00:00 2001 From: Damien Pollet Date: Wed, 16 Feb 2022 16:09:18 +0100 Subject: [PATCH] Update both @ and * record for example.tld domains Resolves #3 --- livedns.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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: