About: find the mail node's name with resolvePtr
ci / version (pull_request) Skipped
ci / node (pull_request) Canceled after 36s
ci / docker-build (pull_request) Canceled after 0s
ci / publish (pull_request) Canceled after 0s

dns.reverse came back empty inside the image while the resolver answered
the PTR, so About showed only the address. Ask for the PTR record of the
in-addr.arpa / ip6.arpa name directly.
This commit is contained in:
jcoffey-dev committed 2026-09-25 21:14:13 -07:00
1 parent 3507a21599
commit 41fb7875d0
2 files changed
+28 -2

No files matched your search

+10 -1
View File
@@ -1,6 +1,6 @@
import { test, beforeEach } from "node:test";
import assert from "node:assert/strict";
import { clearNodeCache, mailNode } from "./nodes.js";
import { clearNodeCache, mailNode, ptrName } from "./nodes.js";
/**
* About names the mail node by the PTR of the address the server's name
@@ -38,3 +38,12 @@ test("the answer is cached for a minute, then looked up again", async () => {
await mailNode("https://mail.example.com", count, rev, 61_000);
assert.equal(calls, 2);
});
test("the PTR name is built for IPv4 and IPv6 alike", () => {
assert.equal(ptrName("192.0.2.52"), "52.2.0.192.in-addr.arpa");
assert.equal(
ptrName("2001:db8::25"),
"5.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa",
);
assert.equal(ptrName("::1"), "1" + ".0".repeat(31) + ".ip6.arpa");
});