getHostByName()

Returns the IP address for a given host name.

Synopsis

string getHostByName(string name [, dyn_string &addr_list]);

Parameters

Parameter Description
name Internet host name (for example, "www.etm.at")
addr_list List of IP addresses suitable for the given Internet host names

Return value

Returns the IP address for a host name. In case of errors, an empty string will be returned and an error message will be displayed in the log viewer.

Error

Wrong or missing arguments.

Description

Returns the IP address for any wanted host name. The parameter addr_list can be used to output further IP addresses that are suitable for a given internet host. The return value of the function is the last value in the addr_list field (addr_list[n]).

Example

Returns the IP address for the host name "www.etm.at".

main()
{
  string name, ip;
  dyn_string addr_list;
  name = "www.etm.at";
  ip = getHostByName(name, addr_list);
  DebugN("IP address:" + ip);
  DebugN("Further IP addresses:" + addr_list);
}

Assignment

Miscellaneous functions

Availability

CTRL