DNS is an internet service that maps domain names, like rosettacode.org, to IP addresses, like 66.220.0.231.

Use DNS to resolve www.kame.net to both IPv4 and IPv6 addresses. Print these addresses.




/* dns in neko */
var host_resolve = $loader.loadprim("std@host_resolve", 1);
var host_to_string = $loader.loadprim("std@host_to_string", 1);
var host_reverse = $loader.loadprim("std@host_reverse", 1);
 
var ip = host_resolve("www.kame.net");
 
$print("www.kame.net: ", ip, ", ", host_to_string(ip), "\n");
$print(host_to_string(ip), ": ", host_reverse(ip), "\n");