Socket
Book a DemoInstallSign in
Socket

unoeuro-dns

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

unoeuro-dns

A client library for the Unoeuro DNS API

latest
Source
npmnpm
Version
0.2.0
Version published
Weekly downloads
6
100%
Maintainers
1
Weekly downloads
 
Created
Source

This is a client wrapper for the Unoeuro API. To use it, you need an account and a key for the API.

All of the methods of the library return promises.

This library is not yet mature, and still lacks features of the UnoEuro API. Pull requests are welcome.

Installation

npm install --save unoeuro-dns

Usage

const api = require('unoeuro-dns')('ACCOUNTNO', 'KEY');

// Get all products
api.products().then(products => /* an array of product objects */ );

// Get all product objects
api.objects().then(objectNames => /* an array of object names */ );

// Get availability status for domain
api.check('domain.net').then(status => /* a status object */ );
api.available('domain.net').then(isAvailable => /* Just the boolean, please */ );

// DNS records
api.dns('object.com')
	.then(info => /* DNS info object */ );

api.records('object.com')
	.then(records => /* An array of DNS records for object.com */ );

api.recordsWhere('object.com', { type: 'A' })
	.then(records => /* An array of A records for object.com */ );

api.find('mydomain.com')
	.then(obj => /* Object name for mydomain.com; will throw if not existing */);

api.addRecord('mydomain.com', { name: '@', type: 'A', data: '100.100.100.100', ttl: 600, priority: 0 })
	.then(status => /* status for insertion */);

api.addRecords('mydomain.com', [ {...} ])
	.then(status => /* array of insertion statuses */);

api.editRecord('mydomain.com', 'RECORD_ID', { name: '@', type: 'A', data: '100.100.100.100', ttl: 600, priority: 0 })
	.then(status => /* status for edit */);

api.deleteRecord('mydomain.com', 'RECORD_ID')
	.then(status => /* deletion status */);

api.clearRecords('mydomain.com', 'A')
	.then(status => /* array of deletion statuses for A records */ );

// Buy a domain
api.buy(domain).then(status => /* status feedback on the purchase */);

DNS records

When inserting or editing DNS records, the fields that can be configured are:

const record = {
	name: '@', // Required. @ = root domain, any other string is a subdomain and * can be used for wildcards
	type: 'A', // Required. Record type (A, MX, etc.)
	data: '100.100.100.100', // Required. The IP or data for the record
	ttl: 600, // Optional. Time-To-Live for the record.
	priority: 0 // Optional. Record priority. 
};

api.addRecord('object.com', record);

FAQs

Package last updated on 28 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