gethostbyname
gethostbyname is a function from the BSD sockets API used to translate a hostname into one or more IPv4 addresses. It is declared in netdb.h and is part of the legacy resolver interface. The function signature is struct hostent *gethostbyname(const char *name);
On success it returns a pointer to a statically allocated hostent structure containing information about the
The hostent structure includes several fields: h_name (official name of the host), h_aliases (null-terminated array of
Limitations and modern usage: gethostbyname is largely considered deprecated for new code due to thread safety