Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

namemaster

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

namemaster

namemaster.de API client

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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) // TTL for records

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)      // 'A', 'MX', 'C', 'SPF', 'TXT'
    console.log(record.dns_id)   // namemaster internal ID
    console.log(record.hostname) // e.g. 'subdomain.example.de'
    console.log(record.ip)       // e.g. '127.0.0.1' (A records)
    console.log(record.alias)    // e.g. 'server.example.de' (C records)
    console.log(record.spf)      // e.g. 'v=spf1 a mx -all' (SPF records)
    console.log(record.txt)      // e.g. 'google-site-verification=...' (TXT records)
  })
})

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) // 'Success'
  console.log(answer.fehler) // 0
})

client.deleteHost

Delete a host A record.

client.deleteHost('subdomain').then(function (answer) {
  console.log(answer.result) // 'Success'
  console.log(answer.fehler) // 0
})

Keywords

FAQs

Package last updated on 24 Nov 2016

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc