New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@domcloud/zone-editor

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@domcloud/zone-editor

edit BIND9 zone file using list of text changes

latest
Source
npmnpm
Version
0.10.1
Version published
Weekly downloads
8
166.67%
Maintainers
1
Weekly downloads
 
Created
Source

BIND9 Zone Editor Library

npm

This library allows you to edit BIND9 zone file using list of text changes. Used by DOM Cloud Bridge for BIND9 DNS zone editing.

This library is ES only. Open demo here.

Usage

npm install @domcloud/zone-editor
import { parseNS, editNS, generateNS } from '@domcloud/zone-editor';
import fs from 'fs';

const path = '/var/named/example.com.hosts';
const input = fs.readFileSync(path, { encoding: 'utf8' });
const data = parseNS(str);
const changes = ['del txt @', 'add txt @ foo=bar baz'];
if (editNS(data, changes) > 0) { // return count of changes, data is mutable
    const result = generateNS(data); // optionally pass custom template here
    fs.writeFileSync(path, result);
}

See also

  • elgs/dns-zonefile

Keywords

dns

FAQs

Package last updated on 16 Jun 2025

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