Mono Class Library: System.Net.Dns Overview | Members

System.Net.Dns.GetHostName Method

Gets the DNS host name of the local machine. [Edit]

public static string GetHostName ()

Returns

A string containing the DNS host name of the local machine. [Edit]

Permissions

TypeReason
System.Net.DnsPermission [Edit] Requires unrestricted permission for accessing DNS information. See System.Net.DnsPermission and System.Security.Permissions.PermissionState.Unrestricted.

Exceptions

TypeReason
System.Net.Sockets.SocketExceptionAn error was encountered resolving the local host name. [Edit]
System.Security.SecurityExceptionThe caller does not have permission to access DNS information. [Edit]

Remarks

Documentation for this section has not yet been entered. [Edit]

Requirements

Namespace: System.Net
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0