hostNameToAddress

Typefunction
DictionaryLCS
LibraryLiveCode Script
Syntax
the hostNameToAddress of <domainName>
hostNameToAddress(<domainName>, [<callback>])
Summary

Returns the IP addresses corresponding to a domain name.

Introduced1.0
OSmac, windows, linux, ios, android
Platformsdesktop, server, mobile
Parameters
NameTypeDescription
domainName

A standard fully-qualified domain name.

callback

The name of a message to send when the lookup completes.

Example
hostNameToAddress("mail.example.org")
put hostNameToAddress("www." & thisDomain) into line 3 of theHosts
hostNameToAddress("www.domain.com", myCallback)
Values
NameTypeDescription
return

The hostNameToAddress function returns the IP addresses corresponding to the domain name, one per line.

The result

The hostNameToAddress function does a DNS lookup on the domainname 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.

RelatedKeyword: numeric
Command: accept
Function: result, DNSServers
Control Structure: function
Glossary: DNS, domain name, IP address
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.

Tagsnetworking