pmcf 1.52.3 → 1.52.4
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/bin/pmcf-named-defs +29 -29
- package/package.json +1 -1
package/bin/pmcf-named-defs
CHANGED
|
@@ -100,7 +100,7 @@ async function generateNamedDefs(owner, targetDir) {
|
|
|
100
100
|
|
|
101
101
|
if (!addresses.has(address)) {
|
|
102
102
|
addresses.add(address);
|
|
103
|
-
|
|
103
|
+
|
|
104
104
|
zone.records.add(
|
|
105
105
|
createRecord(
|
|
106
106
|
fullName(host.domainName),
|
|
@@ -108,6 +108,28 @@ async function generateNamedDefs(owner, targetDir) {
|
|
|
108
108
|
normalizeIPAddress(address)
|
|
109
109
|
)
|
|
110
110
|
);
|
|
111
|
+
|
|
112
|
+
if (subnet) {
|
|
113
|
+
let reverseZone = reverseZones.get(subnet.address);
|
|
114
|
+
|
|
115
|
+
if (!reverseZone) {
|
|
116
|
+
const reverseArpa = reverseArpaAddress(subnet.prefix);
|
|
117
|
+
reverseZone = {
|
|
118
|
+
id: reverseArpa,
|
|
119
|
+
file: `${reverseArpa}.zone`,
|
|
120
|
+
records: new Set([SOARecord, NSRecord])
|
|
121
|
+
};
|
|
122
|
+
zones.push(reverseZone);
|
|
123
|
+
reverseZones.set(subnet.address, reverseZone);
|
|
124
|
+
}
|
|
125
|
+
reverseZone.records.add(
|
|
126
|
+
createRecord(
|
|
127
|
+
fullName(reverseArpaAddress(address)),
|
|
128
|
+
"PTR",
|
|
129
|
+
fullName(host.domainName)
|
|
130
|
+
)
|
|
131
|
+
);
|
|
132
|
+
}
|
|
111
133
|
}
|
|
112
134
|
|
|
113
135
|
if (!hosts.has(host)) {
|
|
@@ -132,28 +154,6 @@ async function generateNamedDefs(owner, targetDir) {
|
|
|
132
154
|
);
|
|
133
155
|
}
|
|
134
156
|
}
|
|
135
|
-
|
|
136
|
-
if (subnet) {
|
|
137
|
-
let reverseZone = reverseZones.get(subnet.address);
|
|
138
|
-
|
|
139
|
-
if (!reverseZone) {
|
|
140
|
-
const reverseArpa = reverseArpaAddress(subnet.prefix);
|
|
141
|
-
reverseZone = {
|
|
142
|
-
id: reverseArpa,
|
|
143
|
-
file: `${reverseArpa}.zone`,
|
|
144
|
-
records: new Set([SOARecord, NSRecord])
|
|
145
|
-
};
|
|
146
|
-
zones.push(reverseZone);
|
|
147
|
-
reverseZones.set(subnet.address, reverseZone);
|
|
148
|
-
}
|
|
149
|
-
reverseZone.records.add(
|
|
150
|
-
createRecord(
|
|
151
|
-
fullName(reverseArpaAddress(address)),
|
|
152
|
-
"PTR",
|
|
153
|
-
fullName(host.domainName)
|
|
154
|
-
)
|
|
155
|
-
);
|
|
156
|
-
}
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
|
|
@@ -205,18 +205,18 @@ async function generateNamedDefs(owner, targetDir) {
|
|
|
205
205
|
export function reverseAddress(address) {
|
|
206
206
|
if (isIPv6Address(address)) {
|
|
207
207
|
return normalizeIPAddress(address)
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
208
|
+
.replaceAll(":", "")
|
|
209
|
+
.split("")
|
|
210
|
+
.reverse()
|
|
211
|
+
.join(".");
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
-
|
|
214
|
+
return address.split(".").reverse().join(".");
|
|
215
215
|
}
|
|
216
216
|
|
|
217
217
|
export function reverseArpaAddress(address) {
|
|
218
218
|
return (
|
|
219
219
|
reverseAddress(address) +
|
|
220
|
-
(isIPv6Address(address) ?
|
|
220
|
+
(isIPv6Address(address) ? ".ip6.arpa" : ".in-addr.arpa")
|
|
221
221
|
);
|
|
222
222
|
}
|