name2ip. Determine IP address by domain name.   [3.4.4]

^inet:name2ip[domain.name]
^
inet:name2ip[domain.name;options]

Method returns IP address for the specified domain name.

Converts string argument containing domain name to a string, containing an IP address corresponding to this name. International domain
names are supported.

Supported options:


Default
Description
$.ipv[4/6/any]
4
IPv4 addresses are returned by default, this specifies to return IPv6 addresses or any addresses.
$.table(true/false)
false

Get a string result or a table with columns ip and version, containing all domain name IP addresses and their type.


Simple example:

^inet:name2ip[parser.ru] will return 195.218.200.16.

Example:

^inet:name2ip[test.артлебедев.рф; $.table(true)]]
^t.sort{$t.ip}
^t.menu{$t.ip $t.version
}}

Result:

91.197.112.64 4
91.197.112.65 4
::1 6



Copyright © 1997–2021 Art. Lebedev Studio | http://www.artlebedev.com Last updated: 24.01.2021