namemaster
Client for Namemaster API. This client library uses bluebird Promises as its
return values.
Create client for a zone
Create a client for a given zone.
const namemaster = require('namemaster')
let client = namemaster('username', 'apiKey', 'example.de')
client.setTTL
Set TTL for requests.
client.setTTL(3600)
client.getHosts
Query the hosts in the zone. As per the Namemaster API, if you use the value
'ALL' as the zone name, this call will return records for all your zones.
client.getHosts().then(function (answer) {
answer.records.forEach(function (record) {
console.log(record.typ)
console.log(record.dns_id)
console.log(record.hostname)
console.log(record.ip)
console.log(record.alias)
console.log(record.spf)
console.log(record.txt)
})
})
client.setHostAddress
Create or set an A record for a host.
client.setHostAddress('subdomain', '127.0.0.1').then(function (answer) {
console.log(answer.result)
console.log(answer.fehler)
})
client.deleteHost
Delete a host A record.
client.deleteHost('subdomain').then(function (answer) {
console.log(answer.result)
console.log(answer.fehler)
})