IDN with Gemini?

Scot gmi1 at scotdoyle.com
Tue Dec 8 02:21:18 GMT 2020


On 12/7/20 3:46 PM, colecmac at protonmail.com wrote:
> On Monday, December 7, 2020 4:00 PM, Scot<gmi1 at scotdoyle.com>  wrote:
>
>> On 12/7/20 12:00 PM,colecmac at protonmail.com  wrote:
>>
>>> What parsing would a client have to do?
>>>
>>> -   Extracting the domain, so it can be punycoded for DNS lookups
>> Can we be sure gemini host resolution will always use the global DNS?
>>
>> Section 4 of RFC 6055 cautions against assuming that all name resolution
>> is using the global DNS and therefore that querying with punycode
>> domain names will succeed:
>>
>>    It is inappropriate for an application that calls a general-purpose
>>    name resolution library to convert a name to an A-label unless the
>>    application is absolutely certain that, in all environments where the
>>    application might be used, only the global DNS that uses IDNA
>>    A-labels actually will be used to resolve the name.
> ... Do you have an example of a system/network that fails on punycode?
>
Yes, an organization's internal network resolver or a user's local
resolver could reply to utf8 queries but not punycode queries.

For example, adding the line:

   10.99.99.1  蛸蛸.jp

to /etc/hosts on Ubuntu 20.04 with resolver systemd-resolved
and running the test program [1] gives this output:

   error querying 'xn--td2aa.jp': Unknown server error

   name '蛸蛸.jp' has ip address 10.99.99.1


[1]
#include <netdb.h>
#include <stdio.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <sys/socket.h>

int show_ip(char *name) {
   struct hostent *entry;
   entry = gethostbyname(name);
   if (entry) {
     printf("name '%s' has ip address %s\n\n", entry->h_name,
            inet_ntoa(*((struct in_addr*)entry->h_addr)));
   } else {
     printf("error querying '%s': %s\n\n", name, hstrerror(h_errno));
   }
}

int main() {
   show_ip("xn--td2aa.jp");
   show_ip("蛸蛸.jp");
}


More information about the Gemini mailing list