IDN conversion dies on null target "." (MX, SRV) ai:claude-opus-5-5 #12

Closed
opened 2026-10-20 14:40:09 +02:00 by mf · 0 comments
Owner

parse() and nice() pass MX and SRV targets through domain_to_ascii() /
domain_to_unicode() (Net::IDN::Encode). For the null target . this dies:

label empty at lib/DNS/Vi.pm line 147.

Affected records:

  • null MX, RFC 7505: example.org. IN MX 0 .
  • null SRV, RFC 2782: _x._tcp.example.org. IN SRV 0 0 0 .

A zone with such a record can't be edited with dnsvi at all.

Reproduce

use DNS::Vi;
print nice(parse(<<'_'));
$ORIGIN example.org.
$TTL 1h
@ SOA ns hm 1 1h 10m 1d 1h
@ NS ns
@ MX 0 .
_

Notes

  • 3811663 (on the #11 branch) worked around it for SRV only. It has been
    reverted there, because it doesn't belong to #11.
  • Package 1.6.2-1+issue11 contains that SRV-only workaround. Null MX is
    still broken there.
  • The local tests did not catch this: they ran against stubs instead of the
    real Net::IDN::Encode.

Fix

Branch fix/issue-12-null-target (9d4a9f8): two small helpers
idn_ascii / idn_unicode pass . through unchanged and are used at all
IDN call sites in lib/DNS/Vi.pm. New test t/20-null-target.t checks the
null MX and null SRV round trip. The full test suite passes, including
t/30-unicode.t.

`parse()` and `nice()` pass MX and SRV targets through `domain_to_ascii()` / `domain_to_unicode()` (Net::IDN::Encode). For the null target `.` this dies: label empty at lib/DNS/Vi.pm line 147. Affected records: - null MX, RFC 7505: `example.org. IN MX 0 .` - null SRV, RFC 2782: `_x._tcp.example.org. IN SRV 0 0 0 .` A zone with such a record can't be edited with dnsvi at all. ### Reproduce ```perl use DNS::Vi; print nice(parse(<<'_')); $ORIGIN example.org. $TTL 1h @ SOA ns hm 1 1h 10m 1d 1h @ NS ns @ MX 0 . _ ``` ### Notes - 3811663 (on the #11 branch) worked around it for SRV only. It has been reverted there, because it doesn't belong to #11. - Package `1.6.2-1+issue11` contains that SRV-only workaround. Null MX is still broken there. - The local tests did not catch this: they ran against stubs instead of the real Net::IDN::Encode. ### Fix Branch `fix/issue-12-null-target` (9d4a9f8): two small helpers `idn_ascii` / `idn_unicode` pass `.` through unchanged and are used at all IDN call sites in `lib/DNS/Vi.pm`. New test `t/20-null-target.t` checks the null MX and null SRV round trip. The full test suite passes, including `t/30-unicode.t`.
mf closed this issue 2026-10-20 15:54:31 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
IUS/dnsvi#12
No description provided.