[SERVER-20762] Add support for unicode hostnames Created: 05/Oct/15 Updated: 01/Mar/23 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | Networking |
| Affects Version/s: | 3.1.8 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Spencer Jackson | Assignee: | Backlog - Service Architecture |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Service Arch
|
| Participants: |
| Description |
|
SockAddr uses getaddrinfo to resolve hostnames. Unfortunately, on Windows, this needs to be GetAddrInfoW to resolve unicode hostnames. From Microsoft's documentation:
Attempting resolution results in the following:
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. |
| Comments |
| Comment by Lauren Lewis (Inactive) [ 24/Feb/22 ] | ||||||||||||||||||||||||
|
We haven’t heard back from you for at least one calendar year, so this issue is being closed. If this is still an issue for you, please provide additional information and we will reopen the ticket. | ||||||||||||||||||||||||
| Comment by Spencer Jackson [ 07/Oct/15 ] | ||||||||||||||||||||||||
|
I set up a local dnsmasq server on my Linux machine. './mongo -
So it looks like punycode does not work in DNS hostnames, but does work in local name resolution. I will amend the body of this ticket to include this information. | ||||||||||||||||||||||||
| Comment by Spencer Jackson [ 07/Oct/15 ] | ||||||||||||||||||||||||
|
On my system, I modified my /etc/hosts to have a line which looks like:
I can then start a mongod and connect to it by:
Hmm. But retrying this under Windows, pointing г.mongodb-sec.com at the local address, yields this:
Ping on the full hostname works correctly, so it appears that getaddrinfo might work on a unicode hostname which isn't a FQDN? I'll need to test this again on Linux with a hostname which is provided from a true DNS server, not /etc/hosts. | ||||||||||||||||||||||||
| Comment by Mark Benvenuto [ 07/Oct/15 ] | ||||||||||||||||||||||||
|
Do we support IDN (Internationalized Domain Name) on Linux today? I am worried about this: https://en.wikipedia.org/wiki/IDN_homograph_attack. |