The source for Environment.MachineName for .NET 4.7.1 is here: https://referencesource.microsoft.com/#mscorlib/system/environment.cs,be0b5c103d248dce
It p / calls GetComputerName , as shown here: https://referencesource.microsoft.com/#mscorlib/microsoft/win32/win32native.cs,0c7d7f4f83d4ddd0
Here is the GetComputerName function: https://msdn.microsoft.com/en-us/library/windows/desktop/ms724295(v=vs.85).aspx , which states:
GetComputerName receives only the NetBIOS name of the local computer. To get the DNS host name, DNS domain name, or fully qualified DNS, call the GetComputerNameEx function.
MSDN for computer names, https://msdn.microsoft.com/en-us/library/ms724220(VS.85).aspx , states:
NetBIOS names consist of 15 bytes of OEM characters, including letters, numbers, hyphens, and periods. Some characters are character set specific. NetBIOS names are usually represented in the OEM character set. The OEM character set is locale dependent. Some OEM character sets represent specific characters as two bytes. NetBIOS names, by convention, are represented in uppercase , where the lowercase to uppercase translation algorithm is a set of OEM characters dependent.
So, NetBIOS names are System.Environment.MachineName by convention, and System.Environment.MachineName returns the NetBIOS name of the system.
source share