[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[idn] The layers and character handling in DNS
There have been several comments on where to do nameprep and use of
different character sets. If I look at how I would like things to
work, if could be like this:
user enters name in application using LOCAL character set.
->
application calls routnes like: gethostbyname
->
gethostbyname converts form LOCAL character set to
normalised (not namepreped) UTF-8 (or other format).
it may reject the query if the name contains forbidden characters.
and sends the query to DNS server.
->
DNS server receives the request, takes the UTF-8, compares it
using the namepreped form of the name to the namepreped form of
the names in the database. If it is a caching server if can do
the matching by binary matching.
->
The DNS server sends the response back to the client using
normalised (original form, not namepreped) UTF-8.
->
gethostbyname (or other routine) returns the answer with names
converted into LOCAL character set.
->
application presents answer using LOCAL chaarcter set to the user.
This way you get:
- applications can use local character set just like now.
They do not have to know about format used for interoperability.
- conversion form local to protocol character set is done in
resolver APIs.
- the complex name matching is done in authorative DNS servers.
Applications needing to compare to names themselves have to know
how to do name matching using nameprep (this could be implemented in
resolver libraries giving all applications a common API for doing this).
All the applications that do not need to compare names (there are a lot)
need not implement more the simple normalisation of UTF-8 (which need
to be done in all applications using UCS for interoperability, if they
want it to work).
If you want to support IDNs in non-upgraded DNS servers you could
require DNS queries to send the query name namepreped, but the answers
must be in original normalised form. This will unfortunately require
nameprep in all applications (or all resolver code) which is not needed
otherwise.
Dan