.NET: Microsoft Technologies based on the .NET software framework. Runtime: An environment required to run apps that aren't compiled to machine language.
Hi @Bryan Johnson ,
Thanks for reaching out.
Even though Windows allows a machine name to contain Chinese characters (and Environment.MachineName can return it correctly in Unicode), DNS resolution is still fundamentally ASCII-based. When Dns.GetHostName() is called, the networking layer attempts to return a DNS-compatible hostname. If proper IDN (punycode) handling isn’t applied, the non-ASCII characters can get converted to "???", which then causes Dns.GetHostEntry() to fail with “No such host is known.”
Regarding your workaround:
Creating an
IDictionaryand setting"machineName"toEnvironment.MachineName
This can work in some cases, but it’s not guaranteed. If the remoting stack still performs DNS resolution on that value and it contains non-ASCII characters, you may hit the same issue again. So it’s more of a partial workaround than a fully reliable fix.
Practically speaking, your safest options are:
- Rename the machine to an ASCII-only hostname (recommended): This aligns with DNS expectations and avoids encoding issues entirely.
- Configure the channel using a fixed IP address instead of relying on hostname resolution. This bypasses DNS and avoids the character encoding problem.
Longer term, since this is using .NET Remoting (HttpChannel), it’s worth noting that the technology is legacy and can be sensitive to environmental quirks like this. If modernization is an option, moving to WCF, gRPC, or ASP.NET Core-based communication would eliminate this category of issue altogether.
Hope this helps! If my answer was helpful - kindly follow the instructions here so others with the same problem can benefit as well.