DNS query: Difference between revisions

Content added Content deleted
No edit summary
Line 651: Line 651:
The DNS lookup methods in Lasso do not support IPv6 addresses at this time, only IPv4.
The DNS lookup methods in Lasso do not support IPv6 addresses at this time, only IPv4.
<lang Lasso>dns_lookup('www.kame.net', -type='A')</lang>
<lang Lasso>dns_lookup('www.kame.net', -type='A')</lang>

=={{header|Lua}}==
{{works with|Lua|5.1 - 5.3}}
{{libheader|LuaSocket}}

<lang lua>local socket = require('socket')
local ip_tbl = socket.dns.getaddrinfo('www.kame.net')

for _, v in ipairs(ip_tbl) do
io.write(string.format('%s: %s\n', v.family, v.addr))
end
</lang>
{{out}}
<pre>
inet: 203.178.141.194
inet6: 2001:200:dff:fff1:216:3eff:feb1:44d7
</pre>


== {{header|NetRexx}} ==
== {{header|NetRexx}} ==