当前位置:主页 > 资料 >

Internationalized domain names in Linux
栏目分类:资料   发布日期:2018-08-02   浏览次数:

导读:本文为去找网小编(www.7zhao.net)为您推荐的Internationalized domain names in Linux,希望对您有所帮助,谢谢! I got the domain ă.cc . How can I use it? Some background info The DNS, which is the system that helps us

本文为去找网小编(www.7zhao.net)为您推荐的Internationalized domain names in Linux,希望对您有所帮助,谢谢!

欢迎访问www.7zhao.net



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

本文来自去找www.7zhao.net

copyright www.7zhao.net

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: copyright www.7zhao.net

  • 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 . People implemented, debated and more than a decade later, . 内容来自www.7zhao.net

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.

欢迎访问www.7zhao.net

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

内容来自www.7zhao.net

At some point, for converting any character (Unicode) into ASCII. This is called Punycode. For my domain, ă.cc , Punycode looks like xn--0da.cc . The character ă is actually 0da . xn-- tells applications this is Punycode. 去找(www.7zhao.net欢迎您

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. 去找(www.7zhao.net欢迎您

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 
     linux-vdso.so.1 (0x00007ffc3dde8000)
     libedit.so.0 => /usr/lib64/libedit.so.0 (0x00007fed5f979000)
     libdns.so.1100 => /usr/lib64/libdns.so.1100 (0x00007fed5f551000)
     liblwres.so.160 => /usr/lib64/liblwres.so.160 (0x00007fed5f33e000)
     libbind9.so.160 => /usr/lib64/libbind9.so.160 (0x00007fed5f12d000)
     libisccfg.so.160 => /usr/lib64/libisccfg.so.160 (0x00007fed5ef01000)
     libisc.so.169 => /usr/lib64/libisc.so.169 (0x00007fed5ec89000)
     libcrypto.so.1.1 => /lib64/libcrypto.so.1.1 (0x00007fed5e802000)
     libcap.so.2 => /lib64/libcap.so.2 (0x00007fed5e5fd000)
     libjson-c.so.4 => /usr/lib64/libjson-c.so.4 (0x00007fed5e3ee000)
     libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fed5e1cf000)
     libxml2.so.2 => /usr/lib64/libxml2.so.2 (0x00007fed5de6a000)
     libz.so.1 => /lib64/libz.so.1 (0x00007fed5dc53000)
     liblzma.so.5 => /lib64/liblzma.so.5 (0x00007fed5da2d000)
     libm.so.6 => /lib64/libm.so.6 (0x00007fed5d692000)
     libdl.so.2 => /lib64/libdl.so.2 (0x00007fed5d48e000)
     libidn.so.12 => /usr/lib64/libidn.so.12 (0x00007fed5d25a000)
     libc.so.6 => /lib64/libc.so.6 (0x00007fed5ce70000)
     libncurses.so.6 => /lib64/libncurses.so.6 (0x00007fed5cc46000)
     libtinfo.so.6 => /lib64/libtinfo.so.6 (0x00007fed5ca1a000)
     /lib64/ld-linux-x86-64.so.2 (0x00007fed5fbb1000) 
    内容来自www.7zhao.net

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

    去找(www.7zhao.net欢迎您

Now a few things come to mind:

www.7zhao.net

  • 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/libidn.so.12
      linux-vdso.so.1 (0x00007ffe1cbdc000)
      libc.so.6 => /lib64/libc.so.6 (0x00007fc7f9785000)
      /lib64/ld-linux-x86-64.so.2 (0x00007fc7f9da3000) 

    copyright www.7zhao.net

  • merge glibc and libidn . It seems this 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 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.

Conclusion

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. 本文来自去找www.7zhao.net

www.7zhao.net


本文原文地址:http://bogdan.nimblex.net/linux/2018/08/01/IDNs-in-linux.html

以上为Internationalized domain names in Linux文章的全部内容,若您也有好的文章,欢迎与我们分享! copyright www.7zhao.net

Copyright ©2008-2017去找网版权所有   皖ICP备12002049号-2 皖公网安备 34088102000435号   关于我们|联系我们| 免责声明|友情链接|网站地图|手机版