Resolve Method  

Resolves a host name to a host IP address.


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


A string value that specifies the host name to resolve.
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.
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.


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