net/dns/resolver: exit node PTR handling rejects uppercase names and accepts non-hex nibbles
Author: RaphaelFakhriCreated Sep 29, 2026Updated Sep 29, 2026
Labelsbugpod/network-features
What is the issue?
unARPA converts a reverse-lookup name to an IP address string when an exit
node or app connector resolves a PTR query with the net package. It has two
defects:
- The
.in-addr.arpa.and.ip6.arpa.suffixes are matched case-sensitively. DNS names are case-insensitive and some resolvers randomize the case of the query name, so4.4.8.8.IN-ADDR.ARPA.fails withbogus PTR name. - The error from
hex.Decodeis ignored for IPv6 names. A name with a non-hex nibble, such asz.0.0.2.0.0.0.0.0.0.0.0.0.0.0.0.b.0.8.0.a.0.0.4.0.b.8.f.7.0.6.2.ip6.arpa., returns the partly decoded address2607:f8b0:400a:80b::2000, and the exit node looks up an unrelated IP.
Steps to reproduce
unARPA("4.4.8.8.IN-ADDR.ARPA.") // "", false; want "8.8.4.4", true
unARPA("z.0.0.2.0.0.0.0.0.0.0.0.0.0.0.0.b.0.8.0.a.0.0.4.0.b.8.f.7.0.6.2.ip6.arpa.")
// "2607:f8b0:400a:80b::2000", true; want "", falseExpected behavior
Suffix matching ignores case, and a name with a non-hex nibble is rejected.
Version
Current main.
Source: tailscale/tailscale