1.0.4 • Published 4 years ago

netcupdns v1.0.4

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

netcupdns

This project is not affiliated with the company netcup GmbH.

javascript/nodejs wrapper for the netcup dns api

Usage

Install

npm i netcupdns

Basic Example

const netcupdns = require('netcupdns');

main();
async function main() {
  let sessionCredentials = await netcupdns.getSessionCredentials(YOURAPIKEY, YOURAPIPASSWORD, YOURCUSTOMERNUMBER);

  console.log(await netcupdns.infoDnsRecords(sessionCredentials, YOURDOMAIN));
}

Functions

every return is async and has to be awaited with the await keyword

/* returns the session credentials; takes the apikey apipassword and customernumber;
you cand find the api details on netcup>ccp>stammdaten>api(top right corner) */
getSessionCredentials(apikey, apipassword, customernumber)

//takes sessionCredentials and domainname; returns array of present dns record for a domain
infoDnsRecords(sessionCredentials, domainname)

//takes record and inserts it; if record already exists (judged by hostname) it overwrites it
insertOrOverwriteRecords(sessionCredentials, domainname, record)

//inserts dns record without checking if it already exists; returns array of updated dns records;
updateDnsRecords(sessionCredentials, domainname, dnsrecords)

//takes single hostname as string; ('mail');returns array of matching records
getRecordsByHostname(sessionCredentials, domainname, hostname)

//takes single type as string; ('AAAA'); returns array of matching records
getRecordsByType(sessionCredentials, domainname, type)

//takes destination as string; returns array with ids of matching records
getRecordsByDestination(sessionCredentials, domainname, destination)

//takes array of records and deletes them;
deleteRecords(sessionCredentials, domainname, recordsToDelete)
1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago