@nictool/dns-resource-record 1.6.0 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -6
- package/README.md +43 -37
- package/package.json +8 -6
package/CHANGELOG.md
CHANGED
|
@@ -4,17 +4,22 @@ Notable changes to this project are documented in this file.
|
|
|
4
4
|
|
|
5
5
|
#### Unreleased
|
|
6
6
|
|
|
7
|
-
### [1.6.
|
|
7
|
+
### [1.6.1] - 2026-04-20
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
- doc(README): add wire export format
|
|
10
|
+
- ci: split coverage to new GHA file, trigger on push to main
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
- feat: add
|
|
12
|
+
### [1.6.0] - 2026-03-26
|
|
13
|
+
|
|
14
|
+
- feat(toWire): add wire export format to every RR, fixes #23
|
|
15
|
+
- feat(getTags): added to all RR types
|
|
14
16
|
- values: common, obsolete, security, dnssec
|
|
15
|
-
-
|
|
17
|
+
- feat(getCanonical): added to RRs where missing
|
|
16
18
|
- added RFCs to: AAAA 5952, NAPTR 4848, SIG 3755, TLSA 7671
|
|
17
19
|
- TXT: 4408, 6376, 7208
|
|
20
|
+
- doc(README): categorize RR types.
|
|
21
|
+
- doc(README): generate the supported RRs table
|
|
22
|
+
- test: add tests for toWire, getCanonical, getTags
|
|
18
23
|
|
|
19
24
|
### [1.5.0] - 2026-03-22
|
|
20
25
|
|
|
@@ -379,3 +384,4 @@ Notable changes to this project are documented in this file.
|
|
|
379
384
|
[1.4.0]: https://github.com/NicTool/dns-resource-record/releases/tag/v1.4.0
|
|
380
385
|
[1.5.0]: https://github.com/NicTool/dns-resource-record/releases/tag/v1.5.0
|
|
381
386
|
[1.6.0]: https://github.com/NicTool/dns-resource-record/releases/tag/v1.6.0
|
|
387
|
+
[1.6.1]: https://github.com/NicTool/dns-resource-record/releases/tag/v1.6.1
|
package/README.md
CHANGED
|
@@ -15,11 +15,12 @@ This module is used to:
|
|
|
15
15
|
| **RR format** | **import** | **export** |
|
|
16
16
|
| :------------------------------------------------------: | :----------------: | :----------------: |
|
|
17
17
|
| **JSON** | :white_check_mark: | :white_check_mark: |
|
|
18
|
-
|
|
|
18
|
+
| **[BIND](https://www.isc.org/bind/) / RFC 1035** | :white_check_mark: | :white_check_mark: |
|
|
19
19
|
| **[Tinydns](https://cr.yp.to/djbdns/tinydns-data.html)** | :white_check_mark: | :white_check_mark: |
|
|
20
20
|
| **MaraDNS** | | :white_check_mark: |
|
|
21
21
|
| **JS** | :white_check_mark: | :white_check_mark: |
|
|
22
22
|
| **PowerDNS** | | |
|
|
23
|
+
| **Wire** | | :white_check_mark: |
|
|
23
24
|
|
|
24
25
|
This package intends to import and export RFC compliant DNS resource records. Please [raise an issue](https://github.com/NicTool/dns-resource-record/issues) if a valid resource record fails to pass or an invalid resource record passes.
|
|
25
26
|
|
|
@@ -104,31 +105,41 @@ The setters are named: `set` + `Field`, where field is the resource record field
|
|
|
104
105
|
|
|
105
106
|
## FUNCTIONS
|
|
106
107
|
|
|
107
|
-
|
|
108
|
+
### getCanonical
|
|
109
|
+
|
|
110
|
+
```js
|
|
111
|
+
> console.log(new RR.AAAA(null).getCanonical())
|
|
112
|
+
{
|
|
113
|
+
owner: 'host.example.com.',
|
|
114
|
+
address: '2001:0db8:0020:000a:0000:0000:0000:0004',
|
|
115
|
+
class: 'IN',
|
|
116
|
+
ttl: 3600,
|
|
117
|
+
type: 'AAAA'
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### getFields
|
|
122
|
+
|
|
123
|
+
Get the field names for each RR type
|
|
108
124
|
|
|
109
125
|
```js
|
|
110
126
|
> import * as RR from 'dns-resource-record'
|
|
111
|
-
> new RR.A(null).getFields()
|
|
112
|
-
[ 'owner', 'ttl', 'class', 'type', 'address' ]
|
|
127
|
+
> new RR.A(null).getFields() // [ 'owner', 'ttl', 'class', 'type', 'address' ]
|
|
113
128
|
|
|
114
|
-
> new RR.PTR(null).getFields()
|
|
115
|
-
[ 'owner', 'ttl', 'class', 'type', 'dname' ]
|
|
129
|
+
> new RR.PTR(null).getFields() // [ 'owner', 'ttl', 'class', 'type', 'dname' ]
|
|
116
130
|
|
|
117
131
|
> new RR.SSHFP(null).getFields()
|
|
118
|
-
[ 'owner', 'ttl', 'class', 'type', 'algorithm', 'fptype', 'fingerprint' ]
|
|
132
|
+
// [ 'owner', 'ttl', 'class', 'type', 'algorithm', 'fptype', 'fingerprint' ]
|
|
119
133
|
```
|
|
120
134
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
```js
|
|
124
|
-
> new RR.A(null).getRFCs()
|
|
125
|
-
[ 1035 ]
|
|
135
|
+
### getRFCs
|
|
126
136
|
|
|
127
|
-
|
|
128
|
-
[ 2782 ]
|
|
137
|
+
Get a list of RFCs references for each RR type
|
|
129
138
|
|
|
130
|
-
|
|
131
|
-
[ 1035
|
|
139
|
+
```js
|
|
140
|
+
> new RR.A(null).getRFCs() // [ 1035 ]
|
|
141
|
+
> new RR.SRV(null).getRFCs() // [ 2782 ]
|
|
142
|
+
> new RR.MX(null).getRFCs() // [ 1035, 2181, 7505 ]
|
|
132
143
|
```
|
|
133
144
|
|
|
134
145
|
### toBind
|
|
@@ -137,10 +148,10 @@ Validate a record and export to BIND format.
|
|
|
137
148
|
|
|
138
149
|
```js
|
|
139
150
|
console.log(new RR.A(exampleRRs.A).toBind())
|
|
140
|
-
test.example.com 3600 IN A 192.0.2.127
|
|
151
|
+
// test.example.com 3600 IN A 192.0.2.127
|
|
141
152
|
|
|
142
153
|
console.log(new RR.AAAA(exampleRRs.AAAA).toBind())
|
|
143
|
-
test.example.com 3600 IN AAAA 2605:7900:20:a::4
|
|
154
|
+
// test.example.com 3600 IN AAAA 2605:7900:20:a::4
|
|
144
155
|
```
|
|
145
156
|
|
|
146
157
|
### toTinydns
|
|
@@ -148,19 +159,7 @@ test.example.com 3600 IN AAAA 2605:7900:20:a::4
|
|
|
148
159
|
Validate a record and export to tinydns format:
|
|
149
160
|
|
|
150
161
|
```js
|
|
151
|
-
console.log(new RR.A(exampleRRs.A).toTinydns())
|
|
152
|
-
+test.example.com:192.0.2.127:3600::
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
### fromTinydns toBind
|
|
156
|
-
|
|
157
|
-
Convert a tinydns line to BIND:
|
|
158
|
-
|
|
159
|
-
```js
|
|
160
|
-
console.log(new RR.CAA({
|
|
161
|
-
tinyline: ':ns1.example.com:257:\\000\\005issue"http\\072\\057\\057letsencrypt.org":3600::\n'
|
|
162
|
-
}).toBind())
|
|
163
|
-
ns1.example.com 3600 IN CAA 0 issue "http://letsencrypt.org"
|
|
162
|
+
console.log(new RR.A(exampleRRs.A).toTinydns()) // +test.example.com:192.0.2.127:3600::
|
|
164
163
|
```
|
|
165
164
|
|
|
166
165
|
### set
|
|
@@ -180,6 +179,17 @@ A(5) [Map] {
|
|
|
180
179
|
|
|
181
180
|
Consider this a "running with scissors" mode.
|
|
182
181
|
|
|
182
|
+
### fromTinydns toBind
|
|
183
|
+
|
|
184
|
+
Convert a tinydns line to BIND:
|
|
185
|
+
|
|
186
|
+
```js
|
|
187
|
+
console.log(new RR.CAA({
|
|
188
|
+
tinyline: ':ns1.example.com:257:\\000\\005issue"http\\072\\057\\057letsencrypt.org":3600::\n'
|
|
189
|
+
}).toBind())
|
|
190
|
+
ns1.example.com 3600 IN CAA 0 issue "http://letsencrypt.org"
|
|
191
|
+
```
|
|
192
|
+
|
|
183
193
|
## Supported Records
|
|
184
194
|
|
|
185
195
|
This module intends to support all current (ie, not officially deprecated) DNS RRs **and** all RRs that are in active use on the internet.
|
|
@@ -254,13 +264,9 @@ PRs are welcome, especially PRs with tests.
|
|
|
254
264
|
- @nictool/[dns-zone](https://www.npmjs.com/package/@nictool/dns-zone)
|
|
255
265
|
- @nictool/[dns-nameserver](https://www.npmjs.com/package/@nictool/dns-nameserver)
|
|
256
266
|
|
|
257
|
-
## TODO
|
|
258
|
-
|
|
259
|
-
- [ ] export a web page for each RR type
|
|
260
|
-
|
|
261
267
|
## DEVELOP
|
|
262
268
|
|
|
263
269
|
- There are no dependencies. That's no accident.
|
|
264
|
-
-
|
|
270
|
+
- ESM browsers and node.js
|
|
265
271
|
- Platform independence is a goal
|
|
266
|
-
- [x] CI tests are on linux, windows, and
|
|
272
|
+
- [x] CI tests are on linux, windows, and macOS
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nictool/dns-resource-record",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"description": "DNS Resource Records",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"files": [
|
|
@@ -12,17 +12,19 @@
|
|
|
12
12
|
"type": "module",
|
|
13
13
|
"scripts": {
|
|
14
14
|
"build": "node lib/readme.js",
|
|
15
|
+
"clean": "rm -rf coverage node_modules package-lock.json",
|
|
15
16
|
"format:check": "npm run prettier; npm run lint",
|
|
16
17
|
"format": "npm run prettier -- --write && npm run lint:fix",
|
|
17
18
|
"lint": "npx eslint **/*.js",
|
|
18
19
|
"lint:fix": "npm run lint -- --fix",
|
|
19
20
|
"prettier": "npx prettier --ignore-path .gitignore --check .",
|
|
20
21
|
"prettier:fix": "npx prettier --ignore-path .gitignore --write .",
|
|
21
|
-
"test": "node --test
|
|
22
|
-
"test:coverage": "
|
|
22
|
+
"test": "node --test",
|
|
23
|
+
"test:coverage": "node --test --experimental-test-coverage",
|
|
24
|
+
"test:coverage:lcov": "mkdir -p coverage && node --test --experimental-test-coverage --test-reporter=lcov --test-reporter-destination=coverage/lcov.info",
|
|
23
25
|
"versions": "npx npm-dep-mgr check",
|
|
24
26
|
"versions:fix": "npx npm-dep-mgr update",
|
|
25
|
-
"watch": "node --test --watch
|
|
27
|
+
"watch": "node --test --watch"
|
|
26
28
|
},
|
|
27
29
|
"repository": {
|
|
28
30
|
"type": "git",
|
|
@@ -49,8 +51,8 @@
|
|
|
49
51
|
"homepage": "https://github.com/NicTool/dns-resource-record#readme",
|
|
50
52
|
"devDependencies": {
|
|
51
53
|
"@eslint/js": "^10.0.1",
|
|
52
|
-
"eslint": "^10.1
|
|
53
|
-
"globals": "^17.
|
|
54
|
+
"eslint": "^10.2.1",
|
|
55
|
+
"globals": "^17.5.0"
|
|
54
56
|
},
|
|
55
57
|
"prettier": {
|
|
56
58
|
"printWidth": 110,
|