Dns.EndGetHostByName(IAsyncResult) Method

Definition

Caution

EndGetHostByName has been deprecated. Use EndGetHostEntry instead.

Caution

EndGetHostByName is obsoleted for this type, please use EndGetHostEntry instead. https://go.microsoft.com/fwlink/?linkid=14202

Caution

EndGetHostByName is obsoleted for this type, please use EndGetHostEntry instead. http://go.microsoft.com/fwlink/?linkid=14202

Ends an asynchronous request for DNS information.

C#
[System.Obsolete("EndGetHostByName has been deprecated. Use EndGetHostEntry instead.")]
public static System.Net.IPHostEntry EndGetHostByName(IAsyncResult asyncResult);
C#
[System.Obsolete("EndGetHostByName is obsoleted for this type, please use EndGetHostEntry instead. https://go.microsoft.com/fwlink/?linkid=14202")]
public static System.Net.IPHostEntry EndGetHostByName(IAsyncResult asyncResult);
C#
[System.Obsolete("EndGetHostByName is obsoleted for this type, please use EndGetHostEntry instead. http://go.microsoft.com/fwlink/?linkid=14202")]
public static System.Net.IPHostEntry EndGetHostByName(IAsyncResult asyncResult);
C#
public static System.Net.IPHostEntry EndGetHostByName(IAsyncResult asyncResult);

Parameters

asyncResult
IAsyncResult

An IAsyncResult instance that is returned by a call to the BeginGetHostByName(String, AsyncCallback, Object) method.

Returns

An IPHostEntry object that contains DNS information about a host.

Attributes

Exceptions

asyncResult is null.

Remarks

This method blocks until the operation is complete.

To perform this operation synchronously, use the GetHostByName method.

If the Ipv6Element.Enabled property is set to true, the Aliases property of the IPHostEntry instance returned is not populated by this method and will always be empty.

Note

This member emits trace information when you enable network tracing in your application. For more information, see Network Tracing in the .NET Framework.

Applies to

Product Versions (Obsolete)
.NET (Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10)
.NET Framework 1.1 (2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1)
.NET Standard (2.0, 2.1)

See also