Skip to content

feat(domain): accept and show internationalized domain names - #331

Merged
jpage-godaddy merged 3 commits into
mainfrom
punycode
Oct 22, 2026
Merged

jpage-godaddy merged 3 commits into
mainfrom
punycode

Conversation

@jpage-godaddy

Copy link
Copy Markdown
Collaborator

DEVEX-1285

Summary

Domain names can be typed as Unicode (münchen.de) or in encoded form (xn--mnchen-3ya.de); both reach the same domain. Names are shown as Unicode by default, and --punycode shows the encoded form instead.

  • Input: domain get, available, quote and nameserver set (including --nameserver hosts) send the ASCII form to the API. dns list/add/set/delete normalize the zone and --name at argument-parse time, and hosting domain attach --hostname does the same. ASCII names, @, * and _dmarc-style labels pass through unchanged. Names are lowercased.
  • Output: domain list/get/available/suggest/quote/purchase, domain nameserver set, domain operation status, dns list/add/set/delete and hosting domain attach/get/list show Unicode by default and ASCII with --punycode. The value stays in the same JSON field, and suggested follow-up commands use the same form.
  • Not converted: DNS record values (CNAME, MX, TXT and so on), the domain suggest query and --tlds, and domain names inside error messages.
  • Implementation: a shared helper in rust/src/idn.rs (to_ascii, to_unicode, DomainForm, and a flattened DomainFormArgs carrying --punycode). validate_domain_name now returns the ASCII form; its Unicode-passthrough test is replaced accordingly. idna becomes a direct dependency (already in the lockfile). The DNS guide gains a short section on international names.

Follow-up

Persisting the preference (gddy config set punycode true) is tracked in DEVEX-1295 and is not part of this change.

Test plan

  • Unit tests for the helper, validate_domain_name, the DNS name parser and the DNS output conversion.
  • cargo check --workspace, cargo clippy --workspace --all-targets -- -D warnings, cargo test --workspace, cargo fmt --check and ./rust/scripts/check-module-size.sh all pass.
  • Manual testing of the affected commands.

🤖 Generated with Claude Code

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Static review identified no blocking issues; workspace checks were not independently rerun.

0 open findings

What changed in this PR

Adds internationalized domain-name support across domain, DNS, and hosting commands.

Changes:

  • Normalizes supported Unicode inputs to ASCII for API requests.
  • Displays Unicode by default, with --punycode for encoded output.
  • Adds shared conversion helpers, unit tests, and DNS guidance.
File Description
rust/​src/​main.rs Registers the IDN module.
rust/​src/​idn.rs Adds conversion helpers, display options, and tests.
rust/​src/​hosting/​domain/​list.rs Formats listed hostnames.
rust/​src/​hosting/​domain/​get.rs Formats hostname details.
rust/​src/​hosting/​domain/​attach.rs Normalizes input and formats output.
rust/​src/​domain/​suggest.rs Formats suggested domains.
rust/​src/​domain/​quote.rs Formats quotes and alternative-search actions.
rust/​src/​domain/​purchase.rs Formats purchase results.
rust/​src/​domain/​operation.rs Formats operation domain names.
rust/​src/​domain/​nameservers.rs Formats results and follow-up domain parameters.
rust/​src/​domain/​list.rs Formats domain listings.
rust/​src/​domain/​get.rs Formats domain details.
rust/​src/​domain/​common.rs Returns validated ASCII names and updates tests.
rust/​src/​domain/​available.rs Formats availability results and follow-up parameters.
rust/​src/​dns/​set/​mod.rs Formats previews and successful updates.
rust/​src/​dns/​records.rs Adds shared name parsing, result formatting, and tests.
rust/​src/​dns/​list.rs Normalizes filters and formats record names.
rust/​src/​dns/​guides/​dns.md Documents international-name behavior.
rust/​src/​dns/​delete.rs Normalizes names and formats deletion output.
rust/​src/​dns/​add.rs Uses shared result formatting.
rust/​Cargo.toml Adds the direct idna dependency.
rust/​Cargo.lock Records the direct dependency relationship.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

- Domain names, DNS record names and hosting hostnames can be typed as
  Unicode (münchen.de) or in encoded form (xn--mnchen-3ya.de); both
  reach the same domain.
- Names are shown as Unicode by default. Add --punycode to show the
  encoded form instead. Available on domain list, get, available,
  suggest, quote, purchase, nameserver set and operation status; dns
  list, add, set and delete; and hosting domain attach, get and list.
- Domain names are lowercased before they are sent.
- DNS record values (CNAME, MX, TXT and so on) are never converted.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@kperkins-godaddy kperkins-godaddy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work on this. Converting input to ASCII when arguments are parsed, showing Unicode on output and never touching record values is a clean way to split it, and the tests cover the edge cases (@, *, _dmarc, undecodable labels) well.

I left a few inline notes. None of them block merging. Two are small tidy-ups: doc comments that got separated from their functions, and a duplicated parser. The rest are questions about lowercasing and the unicodeDomain/idnDomain fields, where I'd like your read. Take whatever's useful.

Comment thread rust/src/dns/records.rs Outdated
Comment thread rust/src/dns/records.rs
Comment thread rust/src/hosting/domain/attach.rs Outdated
Comment thread rust/src/idn.rs
Comment thread rust/src/idn.rs Outdated
Comment thread rust/src/idn.rs Outdated
jpage-godaddy and others added 2 commits October 22, 2026 15:50
- DNS record names, zones and hosting hostnames are lowercased before
  they are sent, matching the domain commands.
- --punycode only changes the fields each command is known to hold
  domain names in. The API's own idnDomain and unicodeDomain fields are
  left as returned.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- Zone, record name and hostname arguments use one parser, so an
  invalid international name reports what to change as well as what is
  wrong.
@jpage-godaddy
jpage-godaddy merged commit 8313527 into main Oct 22, 2026
5 checks passed
@jpage-godaddy
jpage-godaddy deleted the punycode branch October 22, 2026 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants