Skip to content

Parse and generate configuration files for Bind into JSON

License

Notifications You must be signed in to change notification settings

sendanor/dns-namedfile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Parse and generate configuration files for Bind into JSON

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published