Skip to content

Commit

Permalink
Update both @ and * record for example.tld domains
Browse files Browse the repository at this point in the history
Resolves kofemann#3
  • Loading branch information
cdlm committed Feb 16, 2022
1 parent 4996c1a commit 1d1ba89
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions livedns.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 1d1ba89

Please sign in to comment.