edit-dns

v1.0.1
0-dependancy TS library to load, save and recover DNS files
dns resolv network nameserver names ts save load read and 1 more...

edit-dns Build Status

TS library to load, save and recover DNS files

Docs

Install

NPM

npm i edit-dns

Yarn

yarn add edit-dns

Usage

import DnsEditor from 'edit-dns'

const dnsEditor = new DnsEditor('TestApp')

(async () => {
    // Saves current DNS settings
    await dnsEditor.save()

    // Load new DNS settings
    await dnsEditor.load(['1.1.1.1'])

    // Check DNS entry exists
    console.log(await dnsEditor.exists('1.1.1.1')) // true

    // Recover saved settings
    await dnsEditor.recover()

    // Check DNS entry does not exist
    console.log(await dnsEditor.exists('1.1.1.1')) // false
})()

Metadata

  • MIT
  • >=8.0.0
  • Syed Jafri
  • released 4/22/2019

Downloads

Maintainers