edit-dns
v1.1.18
Published
TS library to load, save and recover DNS files
Downloads
27
Maintainers
Readme
edit-dns
TS library to load, save and recover DNS files
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
})()