dns-namedfile

1.0.4 • Public • Published

dns-namedfile

Parse and generate configuration files for Bind into JSON.

Install

npm install -g dns-namedfile

Description

This project can be used to parse partial bind (zone) configuration files into JSON and back to Bind's configuration file.

Notice! It does not parse RR zone files. Look dns-zonefile for that.

Example usage

This is zones.json:

[
   {
      "allowQuery" : [
         "any"
      ],
      "file" : "./zones/example.com.zone",
      "domain" : "example.com",
      "type" : "master"
   },
   {
      "file" : "./zones/example.fi.zone",
      "domain" : "example.fi",
      "type" : "master",
      "allowQuery" : [
         "any"
      ],
      "allowTransfer" : [
         "127.0.0.1",
         "10.1.2.3"
      ]
   }
]

And when you do namedfile -g zones.json > zones.conf, you will get:

zone "example.com" {
type master;
file "./zones/example.com.zone";
allow-query { any; };
};
zone "example.fi" {
type master;
file "./zones/example.fi.zone";
allow-query { any; };
allow-transfer { 127.0.0.1;10.1.2.3; };
};

You can also parse zones.conf back to JSON with: namedfile -p zones.conf > zones.json

Readme

Keywords

Package Sidebar

Install

npm i dns-namedfile

Weekly Downloads

0

Version

1.0.4

License

MIT

Last publish

Collaborators

  • jhh