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

yandex-pdd-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

yandex-pdd-dns

Yandex PDD DNS API

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

yandex-pdd-dns

Installation

yandex-pdd-dns can be installed using npm:

npm install yandex-pdd-dns

CLI Usage

Example:

./node_modules/.bin/yandex-pdd-dns list --domain example.com --token d508b88981b8511f8b5051dc631451cd4b000db8d854b1c9d4b4b918

DynDNS usage:

./node_modules/.bin/yandex-pdd-dns dyndns --domain example.com --token d508b88981b8511f8b5051dc631451cd4b000db8d854b1c9d4b4b918 --subdomain local

API Usage

Example:

var dns = require('yandex-pdd-dns');
var Domain = dns.Domain;
var Api = dns.Api;

var domain = new Domain(new Api(
    'example.com',
    'd508b88981b8511f8b5051dc631451cd4b000db8d854b1c9d4b4b918'
));

var ip = '127.0.0.1';
var subdomain = 'local';

domain.getRecords().then(function (records) {
    var foundRecord;
    records.forEach(function (record) {
        if (record.getType() === 'A' && record.getSubdomain() === subdomain) {
            foundRecord = record;
        }
    });
    if (foundRecord) {
        if (foundRecord.getContent() !== ip) {
            foundRecord.setContent(ip);
            return domain.updateRecord(foundRecord).then(function () {
                console.log('DNS Record was updated');
            });
        } else {
            console.log('DNS Record is up to date');
        }
    } else {
        return domain.addRecord(DomainRecord.fromJSON({
            type: 'A',
            subdomain: subdomain,
            content: ip
        })).then(function () {
            console.log('DNS Record was added');
        });
    }
});

FAQs

Package last updated on 03 Jul 2014

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