world.GetHostName

MUSHclient script function (Method) — introduced in version 3.39

Returns the host name that corresponds to an IP address on the Internet

Prototype

BSTR GetHostName(BSTR IPaddress);

Data type meanings

Description

This returns the name of the host which has a specified IP address, using DNS (Domain Name Server).

Warning - because this function has to connect to a DNS server and await a response it may take some time to execute, perhaps 20 seconds or more.

It should not be used in a script where speed is the essence, or which is executed frequently. If you need to know the answer multiple times you should "cache" the result for future use.

The address should be supplied as a "dotted decimal" string, like "66.36.226.56".

VBscript example

Note GetHostName ("66.36.226.56")

Jscript example

Note (GetHostName ("66.36.226.56"));

PerlScript example

Note (GetHostName ("66.36.226.56"));

Python example

world.Note (world.GetHostName ("66.36.226.56"))

Lua example

Note (GetHostName ("66.36.226.56"))

Return value

Name corresponding to the supplied IP address, or an empty string if it could not be determined.

Related topic

Information

See also

FunctionDescription
GetHostAddressReturns a list of IP addresses that correspond to a host name on the Internet