title: Hostnames resolution fails with "unknown host" error for hostnames containing utf-8 characters
body: <p>I am trying to ping a hostname "win-2k12r2-addc.阿伯测阿伯测ad.hai.com" from a linux client.</p>
  
  <p>I see that DNS requests go over the wire with hostname being sent in utf-8 format
  and i get a response from the DNS server also with the correct IP address.</p>
  
  <p>But ping fails with the following error :
  ping: unknown host win-2k12r2-addc.阿伯测阿伯测ad.hai.com</p>
  
  <p>If i add an entry into /etc/hosts, it works fine<br>
  I have the following entries in /etc/hosts when it works.
  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++<br>
  127.0.0.1      localhost  ava-dev<br>
  ::1      localhost<br>
  10.141.33.93 win-2k12r2-addc.阿伯测阿伯测ad.hai.com<br>
  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<br></p>
  
  <p><br>
  The /etc/nsswitch.conf file has the following entries for hosts.<br>
  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<br>
  hosts:          files dns<br>
  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</p>
  
  <p>I somewhat suspect that getaddrInfo() call fails when we try to resolve the address i.e it is not able to handle the DNS responses correctly for hostnames
  containing unicode characters.</p>
  
  <p>Has anyone faced this issue before ?
  Or has anyone tried resolving a unicode hostname from a linux client ?</p>
  
  <p>The reason i m suspecting getaddrinfo() is because of the following.<br>
  Apart from ping, i m trying the following ldap command to the same host and it fails with the below mentioned error<br>
  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  ldapsearch -d 255 -x -h win-2k12r2-addc.阿伯测阿伯测ad.hai.com<br>
  ldap_create<br>
  ldap_url_parse_ext(ldap://win-2k12r2-addc.%E9%98%BF%E4%BC%AF%E6%B5%8B%E9%98%BF%E4%BC%AF%E6%B5%8Bad.hai.com)<br>
  ldap_sasl_bind<br>
  ldap_send_initial_request<br>
  ldap_new_connection 1 1 0<br>
  ldap_int_open_connection<br>
  ldap_connect_to_host: TCP win-2k12r2-addc.阿伯测阿伯测ad.hai.com:389<br>
  ldap_connect_to_host: getaddrinfo failed: Name or service not known<br>
  ldap_err2string<br>
  ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)<br>
  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</p>
  
  <p>In both the scenarios (ping / ldap), i see the DNS query request going to the DNS server and the correct response from the DNS server back to the linux client.
  The following is the value of the hostname sent in the DNS query <br></p>
  
  <p>win-2k12r2-addc.\351\230\277\344\274\257\346\265\213\351\230\277\344\274\257\346\265\213ad.hai.com: type A, class IN</p>