Resolve Method  
 

Resolves a host name to a host IP address.

Syntax

object.Resolve( HostName, IpAddress, [Reserved] )

Parameters

HostName
A string value that specifies the host name to resolve.
IpAddress
A string variable that will contain the IP address for the specified host name when the method returns. This parameter must be passed by reference.
Reserved
An optional parameter that is reserved for future use. This parameter should be omitted or passed as an empty variant.

Return Value

A value of zero is returned if the host name could be resolved into an IP address. Otherwise, a non-zero error code is returned which indicates the cause of the failure.

Remarks

The Resolve method is used to convert a host name into an IP address. Note that unlike the Query method, this method will use the local host file when resolving the host name. If the host name has both an IPv4 and IPv6 address, this method will return the IPv4 address by default for compatibility with existing applications. It will only return an IPv6 address if the host has no IPv4 address assigned to it.

See Also

HostAddress Property, HostFile Property, HostName Property, Query Method