NLnetLabs / domain

A DNS library for Rust.

Home Page:https://nlnetlabs.nl/projects/domain/about/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clarify domain’s posture on IDNs

Hawk777 opened this issue · comments

As far as I can tell, domain’s posture on internationalized domain names is “not our problem” (i.e. domain requires that labels be ASCII and expects the application to punycode before constructing e.g. Dname objects). That’s fine, but it would be useful if the documentation said so (as far as I can tell, the only way to discover this right now is to pass a non-ASCII string into Dname::from_str and notice that it returns Err).

To be honest, we haven’t gotten as far as thinking about IDNs just yet. They will definitely be part of domain in some form.

The intention for the FromStr impls for basic types is that they assume the types to appear as they would in zonefiles. I think for domain names that would mean their punycoded form. I thought I had mentioned that somewhere in the documentation but apparently that’s not the case. I shall rectify that.

I’ve added notes to the various functions that parse strings in #177 – is that roughly what you had in mind?

That covers parsing pretty well AFAICT. Maybe it’s worth also mentioning something around formatting, e.g. Display impls for the Dname types and Label?

True. I’ll leave the issue open as a reminder for now. I am considering re-writing the documentation around domain name making the difference between wire and presentation format more clear – this will then also include guidance on IDNs.

That would be a good change too—it’s not totally clear to me right now which functions take which form (I’m pretty sure the octets ones take wire format, but that could be called out explicitly).