A | B | C |  D | E | F |  G | H | I |  J | K | L |  M | N | O |  P | Q | R |  S | T | U |  V | W | X |  Y | Z



gethostbyname

The Windows Sockets gethostbyname function retrieves host information corresponding to a host name from a host database.

VB4-32,5,6
Declare Function gethostbyname Lib "WSOCK32" (ByVal szHost As String) As Long

VB.NET
System.Net.Dns.GetHostByName

Operating Systems Supported
Requires Windows Sockets 1.1 or later

Library
Wsock32

Parameter Information
- name
[out] A pointer to the null-terminated name of the host to resolve.

Return Values
If no error occurs, gethostbyname returns a pointer to the HOSTENT structure described above. Otherwise, it returns a NULL pointer and a specific error number can be retrieved by calling WSAGetLastError.

Last update: 07 April 2006