Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nbuchwitz/nc_dnsapi
API wrapper for the netcup DNS API
https://github.com/nbuchwitz/nc_dnsapi
api dns hacktoberfest netcup
Last synced: 17 days ago
JSON representation
API wrapper for the netcup DNS API
- Host: GitHub
- URL: https://github.com/nbuchwitz/nc_dnsapi
- Owner: nbuchwitz
- License: gpl-3.0
- Created: 2018-08-10T11:16:51.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-16T16:21:21.000Z (almost 2 years ago)
- Last Synced: 2024-09-09T10:08:00.522Z (4 months ago)
- Topics: api, dns, hacktoberfest, netcup
- Language: Python
- Homepage:
- Size: 28.3 KB
- Stars: 15
- Watchers: 3
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nc_dnsapi
A simple API wrapper for the netcup DNS API```python
from nc_dnsapi import Client, DNSRecordcustomer = 123456
api_key = "your-personal-api-key"
api_password = "your-private-api-password"with Client(customer, api_key, api_password) as api:
# fetch records
records = api.dns_records("example.com")
for record in records:
print(record)
# fetch zone details
zone = api.dns_zone("example.com")
print(zone)
# update single record
api.update_dns_record("example.com", DNSRecord("my-hostname", "A", "127.0.0.2", id=108125))
# update list of records
api.update_dns_record("example.com", [ DNSRecord("my-hostname", "A", "127.0.0.2", id=108125),
DNSRecord("my-hostname2", "A", "127.0.0.2", id=108126)])
# delete record
api.delete_dns_record("example.com", DNSRecord("my-hostname", "A", "127.0.0.2", id=108125))
# add record
api.add_dns_record("example.com", DNSRecord("another-host", "AAAA", "::1"))# update zone
zone = api.dns_zone("example.com")
zone.refresh = 3600
api.update_dns_zone("example.com", zone)
```