|
|
|
| Title | Get the computer's DNS name in VB .NET |
| Description | This example shows how to get the computer's DNS name in VB .NET. It uses the GetHostByName method to get information about "localhost." |
| Keywords | DNS, name, computer name, host name |
| Categories | Windows, Miscellany |
|
|
|
The program uses the System.Net.Dns.GetHostByName method to get information about the "host" named "localhost." It uses the returned object's HostName property.
|
|
lblDsnName.Text = _
System.Net.Dns.GetHostByName("localhost").HostName
|
|
|
See the Knowledge Base article 302656 How To Obtain the NetBIOS and DNS Computer Names by Using VB.NET.
|
| |
|
| |
|
|