Socket
Socket
Sign inDemoInstall

nc-dnsapi

Package Overview
Dependencies
1
Maintainers
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    nc-dnsapi

API wrapper for the netcup DNS api


Maintainers
1

Readme

nc_dnsapi

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("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)

FAQs


Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc