Net::ResolveHostname
- Net::ResolveHostname(hostname, addressFamily): String
-
Resolve hostname to IP address
Table 1. Parameters hostname
String
Hostname
addressFamily
Integer
Optional.
6to resolve to an IPv6 address; any other value or omitted resolves to IPv4.The function is registered with a fixed count of one argument, so a call with addressFamilyfails with an invalid argument count error and only IPv4 resolution is available (known issue, netxms#3804).ReturnIP address of the requested family as a String, or
nullif the name cannot be resolved.println(Net::ResolveHostname("localhost")); //Will print "127.0.0.1"