Skip to main content

API wrapper for the netcup DNS api

Project description


A simple API wrapper for the netcup DNS API

from nc_dnsapi import Client, DNSRecord

customer = 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("")
    for record in records:

    # fetch zone details
    zone = api.dns_zone("")

    # update single record
    api.update_dns_record("", DNSRecord("my-hostname", "A", "", id=108125))

    # update list of records
    api.update_dns_record("", [ DNSRecord("my-hostname", "A", "", id=108125), 
        DNSRecord("my-hostname2", "A", "", id=108126)])

    # delete record
    api.delete_dns_record("", DNSRecord("my-hostname", "A", "", id=108125))

    # add record
    api.add_dns_record("", DNSRecord("another-host", "AAAA", "::1"))

    # update zone
    zone = api.dns_zone("")
    zone.refresh = 3600
    api.update_dns_zone("", zone)

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for nc-dnsapi, version 0.1.5
Filename, size File type Python version Upload date Hashes
Filename, size nc_dnsapi-0.1.5-py3-none-any.whl (3.4 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size nc_dnsapi-0.1.5.tar.gz (3.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page