getHostByAddr()

Returns the host name for a given IP address.

Synopsis

string getHostByAddr(string name);

Parameters

Parameter Description
name

IP-Adresse (z.B. 192.168.170.15)

IP address (for example, 192.168.170.15)

Return value

Returns the host name for a given IP address. If the name cannot be resolved (e.g. because of timeouts), the IP address is returned as string. In case of errors (if the given defined string cannot be converted to a valid IP address), an empty string will be returned and an error message will be displayed in the log viewer.

Error

Wrong or missing arguments.

Description

This function returns the host name wanted for any IP address.

It is to consider that, the function can cause a delay in the range of seconds until a host name can be determined.

Example

Returns the host name for the IP address 192.168.170.15

main()
{
  string name, host;
  name = "192.168.170.15";
  host = getHostByAddr(name);
  DebugN("Host name:" + host);
}

Assignment

Miscellaneous functions

Availability

CTRL