Name: hostNameToAddress

Type: function

Syntax: the hostNameToAddress of <domainName> 

Syntax: hostNameToAddress(<domainName>, [<callback>])

Summary: Returns the <IP address|IP addresses> corresponding to a <domain name>.

Introduced: 1.0

OS: mac,windows,linux,ios,android

Platforms: desktop,server,web,mobile

Example:
hostNameToAddress("mail.example.org")

Example:
put hostNameToAddress("www." & thisDomain) into line 3 of theHosts

Example:
hostNameToAddress("www.domain.com", myCallback)

Parameters:
domainName: A standard fully-qualified <domain name>.
callback: The name of a message to send when the lookup completes.

The result: The <hostNameToAddress> <function> does a <DNS> lookup on the <domain name> in order to find the <IP address>. This means that the computer must be connected to the Internet in order to use this <function>. If a connection to the Internet is not available, the <hostNameToAddress> <function> returns an error message in the <result> function.

Returns: The <hostNameToAddress> function returns the <IP address|IP addresses> corresponding to the <domain name>, one per line.

Description:
Use the <hostNameToAddress> <function> to find the <numeric> <IP address> of the computer or computers at a given <domain name>.

If the <callback> parameter is specified then the call will return immediately and upon completion of the lookup, the callback will be invoked with the resolved address as a parameter.

References: numeric (keyword), accept (command), result (function), DNSServers (function), DNS (glossary), domain name (glossary), IP address (glossary), function (control_st)

Tags: networking
