{"id":18338707,"url":"https://github.com/tableflip/zonefile-parser","last_synced_at":"2025-04-06T05:31:49.749Z","repository":{"id":57406476,"uuid":"48707007","full_name":"tableflip/zonefile-parser","owner":"tableflip","description":"A zonefile dns configuration parser","archived":false,"fork":false,"pushed_at":"2015-12-29T01:57:58.000Z","size":31,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-21T18:01:46.213Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tableflip.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-28T18:45:38.000Z","updated_at":"2023-09-14T22:47:30.000Z","dependencies_parsed_at":"2022-09-05T07:30:44.041Z","dependency_job_id":null,"html_url":"https://github.com/tableflip/zonefile-parser","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tableflip%2Fzonefile-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tableflip%2Fzonefile-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tableflip%2Fzonefile-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tableflip%2Fzonefile-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tableflip","download_url":"https://codeload.github.com/tableflip/zonefile-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247440346,"owners_count":20939221,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T20:14:55.015Z","updated_at":"2025-04-06T05:31:49.358Z","avatar_url":"https://github.com/tableflip.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zonefile-parser\n\nA DNS zonefile parser module with no runtime dependencies, generated from the [PEG.js](https://github.com/pegjs/pegjs) grammar https://github.com/tableflip/zonefile-pegjs\n\nHandles **multi-line SOA and TXT records**, as well as **SRV, MX, CNAME, NS, AAAA, A** and friends.\n\n## Install\n\n```sh\nnpm install zonefile-parser\n```\n\n## Usage\n\nThe parser comes in two flavors:\n\n **fast.js**, the default module exported:\n\n```js\nvar parser = require('zonefile-parser')\nparser.parse('tableflip.io. 21599 IN A 178.62.82.182')\n// { origin: null, ttl: null, records:[ { name:'tableflip.io.', ttl: '21599', type:'A', data: '178.62.82.182' } ] }\n```\n\nand **small.js** in case you're browserifying and want to shave a few bytes:\n\n```js\nvar parser = require('zonefile-parser/small')\nparser.parse('tableflip.io. 21599 IN A 178.62.82.182')\n// { origin: null, ttl: null, records:[ { name:'tableflip.io.', ttl: '21599', type:'A', data: '178.62.82.182' } ] }\n```\n\n## Command line tool\n\nInstall it globally\n\n ```sh\n npm install -g zonefile-parser\n ```\n\nand use it from your shell as `zonefile` to convert a zonefile to JSON on stdout:\n\n```sh\n$ zonefile ../zonefile-pegjs/test/example.zone\n{\n  \"origin\": \"example.org.\",\n  \"ttl\": \"2d\",\n  \"records\": [\n    {\n      \"name\": \"@\",\n      \"ttl\": null,\n      \"type\": \"SOA\",\n      \"data\": {\n        \"nameServer\": \"ns1.example.org.\",\n        \"email\": \"hostmaster.example.org.\",\n        \"serial\": \"2003080800\",\n        \"refresh\": \"12h\",\n        \"retry\": \"15m\",\n        \"expiry\": \"3w\",\n        \"minimum\": \"3h\"\n      }\n    }\n  ]\n}\n```\n\nA [(╯°□°）╯︵TABLEFLIP](https://tableflip.io) side project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftableflip%2Fzonefile-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftableflip%2Fzonefile-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftableflip%2Fzonefile-parser/lists"}