Nodejs module for Parse and Generate zoneFile of Bind DNS. Manager system
Use the npm for install
npm install bind-zone-manager --save
The module developed for Bind9 system and support basic zone files options.
/*
import module
*/
const ZoneManager = require('bind-zone-manager')
/*
generate new manager without zone File path if you want work
with zoneFile follow `new ZoneManager(<ZoneFilePath>)`
*/
const manager = new ZoneManager()
/*
Parse raw data, if you used <ZoneFilePath> for generate manager
You do not need to define {RawData} in Parse function
*/
var parsedData = manager.Parse({RawData})
/*
generate {custom-list} to string and you can write it to zone
file or anything you want to do with it
*/
var generatedData = manager.Generate({custom-list})
zone "test.com" {
type master;
file "record-db-file-path";
};
zone "test2.com" {
type master;
file "record-db-file-path";
};
[
{
Host:"test.com",
Type:"master",
DbFilePath:"record-db-file-path"
},
{
Host:"test2.com",
Type:"master",
DbFilePath:"record-db-file-path"
}
]
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.