Internationalized domain names Linux

The Internet was made for Latin script, more specifically a-z, 0-9 and a hyphen. Of course, I’m talking about Internet addresses, which is exactly how you reach content online. The problem is that around 2 billion people actually use Chinese, Arabic, Devanagari, Cyrillic and other writing systems. Even the French, Germans and Romanians have non-latin characters so let’s see how those are handled online.

I got the domain ă.cc. How can I use it?

IDNs map

Some background info

The DNS, which is the system that helps us get around online using names instead of IP addresses is restricted to only ASCII characters. It makes sense to me because:

  • The Americans who invented DNS can’t really be blamed that they didn’t think of characters they didn’t understand.
  • Coordinating the update of many servers on the Internet to support some major new feature is not reasonable.
  • Adding UTF-8 could be a huge liability. It has some strange characters such as blank and go back one character. This would open interesting possibilities.

Nevertheless, in 1996 a guy from Zurich felt that we need domains with all types of characters so he wrote a draft. People implemented, debated and more than a decade later, in 2009 ICANN brought the languages of the world to the global Internet.

Internationalized domain names (IDNs for short) are domain names which use non-ASCII characters and could be helpful to more than 30% of the world population.

But all this time DNS didn’t change, so how does this work?!

At some point, some guy proposed a standard for converting any character (Unicode) into ASCII. This is called Punycode. For my domain, ă.cc, Punycode looks like The character ă is actually 0da. xn-- tells applications this is Punycode.

So, IDNs are implemented at the application level. Internet Explorer started to support this late 2006 and others a little bit earlier but it seems that 12 years later, support is poor in pretty much any other basic tool.

The Linux situation

  • SSH, traceroute and many others don’t support IDNs.
  • The browsers, nslookup and dig are OK.
  1. The thing that handles resolving domain names in Linux is glibc, which has some resolver code copied mostly from BIND. BIND is that DNS server which we talked about in the beginning, that only supports ASCII.
  2. Pretty much all programs link against glibc and when they need to resolve some address, glibc handles it for them.
  3. There is a library in Linux, called libidn, which handles the conversion to Punycode.
  4. nimblex:~# ldd /usr/bin/nslookup (0x00007ffc3dde8000) => /usr/lib64/ (0x00007fed5f979000) => /usr/lib64/ (0x00007fed5f551000) => /usr/lib64/ (0x00007fed5f33e000) => /usr/lib64/ (0x00007fed5f12d000) => /usr/lib64/ (0x00007fed5ef01000) => /usr/lib64/ (0x00007fed5ec89000) => /lib64/ (0x00007fed5e802000) => /lib64/ (0x00007fed5e5fd000) => /usr/lib64/ (0x00007fed5e3ee000) => /lib64/ (0x00007fed5e1cf000) => /usr/lib64/ (0x00007fed5de6a000) => /lib64/ (0x00007fed5dc53000) => /lib64/ (0x00007fed5da2d000) => /lib64/ (0x00007fed5d692000) => /lib64/ (0x00007fed5d48e000) => /usr/lib64/ (0x00007fed5d25a000) => /lib64/ (0x00007fed5ce70000) => /lib64/ (0x00007fed5cc46000) => /lib64/ (0x00007fed5ca1a000)
     /lib64/ (0x00007fed5fbb1000)

    nslookup links against libidn and that’s why it can resolve my domain; ă.cc

Now a few things come to mind:

  • link glibc against libidn to support resolving internationalized domains names. Well, this is stupid because glibc is primordial. libidn links to it, not the other way around.
    nimblex:~# ldd /usr/lib64/ (0x00007ffe1cbdc000) => /lib64/ (0x00007fc7f9785000)
      /lib64/ (0x00007fc7f9da3000)
  • merge glibc and libidn. It seems this was done before ICAN made their grand announcement, almost a decade ago, but then abandoned.
  • link tools like ping, ssh and others against libidn.
    • it looks like for ping, libidn was encouraged since 2015 but many distros don’t support it yet. Still, I’m sure ping will support IDNs in most distros soon.
    • for ssh the territory is virgin.


In 2018 we have AI which recognizes my face better than my family but most tools don’t work with domains such as рнидс.срб. It seems seriously limiting and I don’t like that. I guess I will start bothering some people about this.