GithubHelp home page GithubHelp logo

ncdapi's Introduction

UNMAINTAINED ncdapi (inofficial netcup DNS API Client)

This script is currently unmaintained. Due to the fact that changes need at least 10 minutes to be applied and the api still does not support setting a ttl per record.

WARNING

This client is well tested, but it is possible that some actions provoke a bug, so the use of this client is on your own risk and may result in lost of your zone data.

Requirements

  • jq (a json parser)
  • curl

Credentials

To use this script you must replace the values in nc_credentials.env with your:

#Credentials
NC_APIKEY=YOUR_API_KEY
NC_APIPW=YOUR_API_PASSWORD 
NC_CID=YOUR_CUSTOMERNUMBER

How to use

IMPORTANT: Only ONE Argument like -N or -dN
If you have a string which is including spaces use "around your string"
  
-d   Debug Mode         ncdapi.sh -d...
-N   NEW Record         ncdapi.sh -N HOST DOMAIN RECORDTYPE DESTINATION [PRIORITY]
-M   MOD Record         ncdapi.sh -M ID HOST DOMAIN RECORDTYPE DESTINATION [PRIORITY]
-D   DEL Record         ncdapi.sh -D ID HOST DOMAIN RECORDTYPE DESTINATION [PRIORITY]
-g   get all Records	ncdapi.sh -g DOMAIN
-b   backup from Zone	ncdapi.sh -b DOMAIN
-R   Restore Zone	ncdapi.sh -R FILE
-s   get SOA    	ncdapi.sh -s DOMAIN
-S   change SOA    	ncdapi.sh -S DOMAIN TTL REFRESH RETRY EXPIRE DNSSECSTATUS
-l   list all Domains	ncdapi.sh -l
-h   this help

Examples:
New CAA Record:  ncdapi.sh -N @ example.com CAA "0 issue letsencrypt.org"
New   A Record:  ncdapi.sh -N @ example.com A 127.0.0.1
New  MX Record:  ncdapi.sh -N @ example.com MX mail.example.com 20
Get all records: ncdapi.sh -g example.com
Delete Record:   ncdapi.sh -D 1234567 @ example.com A 127.0.0.1
Change SOA:	 ncdapi.sh -S example.com 3600 28800 7200 1209600 true

Functions

  • add new record
  • modify record/SOA
  • delete record
  • get all records/domains
  • backup/restore of zone + SOA
  • If the api returns a failure the session will automatically make invalid and the plain JSON from the api will be written to stdout

TODO

  • DynDNS capability if the api get the possibility for per record TTL in near future
  • ...

How to obtain the DNS entry ID?

First, login to the netcup website. Navigate to "Domains" -> choose your domain -> "DNS" section:

netcup NDS section

Then click with the right mouse button on the desired DNS entry from which the ID should come from. Choose the "inspect element" menue entry.

DNS entries for a domain

Now you should see the developer tools and a <input>-element. The number in the name-attribute's value after record[ is the wanted number.

DNS entry's ID

Copy this ID (here: 12176576) into your script.

developed by linux-insideDE @GPN18

ncdapi's People

Contributors

linxside avatar peronia avatar basbebe avatar hpuac avatar yoxcu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.