-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: 3.1.8
-
Component/s: Networking
-
Server Programmability
-
None
-
None
-
None
-
None
-
None
-
None
-
None
SockAddr uses getaddrinfo to resolve hostnames. Unfortunately, on Windows, this needs to be GetAddrInfoW to resolve unicode hostnames. From Microsoft's documentation:
The Unicode version of this function is GetAddrInfoW. Developers are encouraged to use the GetAddrInfoW Unicode function rather than the getaddrinfo ANSI function.
Attempting resolution results in the following:
PS C:\Program Files\MongoDB\Server\3.1\bin> .\mongo.exe --sspiHostnameCanonicalization forwardAndReverse --host г.mongod
b-sec.com
MongoDB shell version: 3.1.9-pre-
connecting to: г.mongodb-sec.com:27017/test
2015-10-05T18:49:53.438+0000 I NETWORK [thread1] getaddrinfo("г.mongodb-sec.com") failed: errno:11001 No such host is k
nown.
2015-10-05T18:49:53.439+0000 E QUERY [thread1] Error: couldn't initialize connection to host г.mongodb-sec.com, addre
ss is invalid :
connect@src/mongo/shell/mongo.js:216:14
@(connect):1:6
exception: connect failed
PS C:\Program Files\MongoDB\Server\3.1\bin> ping г.mongodb-sec.com
Pinging г.mongodb-sec.com [172.31.33.50] with 32 bytes of data:
Request timed out.
Ping statistics for 172.31.33.50:
Linux appears to support unicode hostnames used in /etc/hosts, but not when speaking with an RFC compliant DNS server. If hostnames are manually converted to Punycode, they will work.
Windows appears to understand punycode during local name resolution, but the Windows DNS server does not seem to understand it when it is used in a request. According to this: https://technet.microsoft.com/en-us/library/cc779394%28v=ws.10%29.aspx the DNS server directly speaks UTF-8 by default.