UNPKG

aladinnetwork-zonefile

Version:

A DNS zone file parser and generator

42 lines (31 loc) 746 B
# aladinnetwork-zonefile ### Installation ```bash $ npm install aladinnetwork-zonefile ``` ### Usage #### Making Zone Files ```js import { makeZoneFile } from 'aladinnetwork-zonefile' let zoneFileText = makeZoneFile(zoneFileJson) ``` #### Parsing Zone Files ```js import { parseZoneFile } from 'aladinnetwork-zonefile' let zoneFileJson = parseZoneFile(zoneFileText) ``` #### Zone File Objects ```js import { ZoneFile } from 'aladinnetwork-zonefile' let zoneFileData = { "$origin": "MYDOMAIN.COM.", "$ttl": 3600, "a": [ { "name": "@", "ip": "127.0.0.1" }, { "name": "www", "ip": "127.0.0.1" } ] } let zoneFile = new ZoneFile(zoneFileData) let zoneFileString = zoneFile.toString() let zoneFileJson = zoneFile.toJSON() ```