netcupdns

1.0.4 • Public • Published

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)

Readme

Keywords

Package Sidebar

Install

npm i netcupdns

Weekly Downloads

0

Version

1.0.4

License

ISC

Unpacked Size

6.8 kB

Total Files

3

Last publish

Collaborators

  • firstdorsal