diff --git a/dyn_gandi/main.py b/dyn_gandi/main.py index 52f826d..bf9173e 100644 --- a/dyn_gandi/main.py +++ b/dyn_gandi/main.py @@ -79,11 +79,8 @@ def checkRecords(api: dict[str, dict[str, list[str]]], current_ip: str, log: Cal def renewRecords(api: dict[str, dict[str, list[str]]], current_ip: str, log: Callable[[str], Any], ttl) -> None: # Updates the records and reates them if they don't exist payload = json.dumps({ - 'items': [{ - 'rrset_type': 'A', - 'rrset_values': [current_ip], - 'rrset_ttl': ttl - }] + 'rrset_values': [current_ip], + 'rrset_ttl': ttl }) for key, domains in api.items(): @@ -95,7 +92,7 @@ def renewRecords(api: dict[str, dict[str, list[str]]], current_ip: str, log: Cal for domain, records in domains.items(): for record in records: response = requests.put( - f"https://api.gandi.net/v5/livedns/domains/{domain}/records/{record}", data=payload, headers=headers) + f"https://api.gandi.net/v5/livedns/domains/{domain}/records/{record}/A", data=payload, headers=headers) if response.status_code == 201: log(f"[OK][{domain}][{record}] Renewed with IP '{current_ip}'") else: