Skip to content

Commit 1d1ba89

Browse files
committed
Update both @ and * record for example.tld domains
Resolves #3
1 parent 4996c1a commit 1d1ba89

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

livedns.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,16 @@ def set_gandi_ip(addr, domain, hostname):
6060

6161
# if this is a top domain (a-la kofemann.dev) then use '@' as a special placeholder for empty name
6262
if fqdn.find('.', dot + 1) == -1:
63-
hostname = '@'
63+
hostnames = [ '@', '*' ]
6464
domain = fqdn
6565
else:
66-
hostname = fqdn[:dot]
66+
hostnames = [ fqdn[:dot] ]
6767
domain = fqdn[dot+1:]
6868

6969
try:
70-
set_gandi_ip(ip, domain, hostname)
71-
new_ip = get_gandi_ip(domain, hostname)
70+
for hostname in hostnames:
71+
set_gandi_ip(ip, domain, hostname)
72+
new_ip = get_gandi_ip(domain, hostname)
7273
print('good')
7374
except urllib.error.HTTPError as e:
7475
if e.code == 401:

0 commit comments

Comments
 (0)