PNG  IHDR* pHYs+ IDATx]n#; cdLb Ǚ[at¤_:uP}>!Usă cag޿ ֵNu`ݼTâabO7uL&y^wFٝA"l[|ŲHLN밪4*sG3|Dv}?+y߉{OuOAt4Jj.u]Gz*҉sP'VQKbA1u\`& Af;HWj hsO;ogTu uj7S3/QzUr&wS`M$X_L7r2;aE+ώ%vikDA:dR+%KzƉo>eOth$z%: :{WwaQ:wz%4foɹE[9<]#ERINƻv溂E%P1i01 |Jvҗ&{b?9g=^wζXn/lK::90KwrюO\!ջ3uzuGv^;騢wq<Iatv09:tt~hEG`v;3@MNZD.1]L:{ծI3`L(÷ba")Y.iljCɄae#I"1 `3*Bdz>j<fU40⨬%O$3cGt]j%Fߠ_twJ;ABU8vP3uEԑwQ V:h%))LfraqX-ۿX]v-\9I gl8tzX ]ecm)-cgʒ#Uw=Wlێn(0hPP/ӨtQ“&J35 $=]r1{tLuǮ*i0_;NƝ8;-vݏr8+U-kruȕYr0RnC]*ެ(M:]gE;{]tg(#ZJ9y>utRDRMdr9㪩̞zֹb<ģ&wzJM"iI( .ꮅX)Qw:9,i좜\Ԛi7&N0:asϓc];=ΗOӣ APqz93 y $)A*kVHZwBƺnWNaby>XMN*45~ղM6Nvm;A=jֲ.~1}(9`KJ/V F9[=`~[;sRuk]rєT!)iQO)Y$V ی ۤmzWz5IM Zb )ˆC`6 rRa}qNmUfDsWuˤV{ Pݝ'=Kֳbg,UҘVz2ﴻnjNgBb{? ߮tcsͻQuxVCIY۠:(V뺕 ٥2;t`@Fo{Z9`;]wMzU~%UA蛚dI vGq\r82iu +St`cR.6U/M9IENDB` REDROOM
PHP 5.6.40
Preview: dns.html Size: 4.60 KB
//usr/share/doc/lua-socket/dns.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 
    "http://www.w3.org/TR/html4/strict.dtd">
<html>

<head>
<meta name="description" content="LuaSocket: DNS support">
<meta name="keywords" content="Lua, LuaSocket, DNS, Network, Library, Support">
<title>LuaSocket: DNS support</title>
<link rel="stylesheet" href="reference.css" type="text/css">
</head>

<body>

<!-- header +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

<div class=header>
<hr>
<center>
<table summary="LuaSocket logo">
<tr><td align=center><a href="http://www.lua.org">
<img width=128 height=128 border=0 alt="LuaSocket" src="luasocket.png">
</a></td></tr>
<tr><td align=center valign=top>Network support for the Lua language
</td></tr>
</table>
<p class=bar>
<a href="index.html">home</a> &middot;
<a href="index.html#download">download</a> &middot;
<a href="installation.html">installation</a> &middot;
<a href="introduction.html">introduction</a> &middot;
<a href="reference.html">reference</a> 
</p>
</center>
<hr>
</div>

<!-- dns ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

<h2 id=dns>DNS</h2> 

<p>
IPv4 name resolution functions 
<a href=#toip><tt>dns.toip</tt></a>
and
<a href=#tohostname><tt>dns.tohostname</tt></a>
return <em>all</em> information obtained from 
the resolver in a table of the form:
</p>

<blockquote><tt>
resolved4 = {<br>
&nbsp;&nbsp;name = <i>canonic-name</i>,<br>
&nbsp;&nbsp;alias = <i>alias-list</i>,<br>
&nbsp;&nbsp;ip = <i>ip-address-list</i><br>
}
</tt> </blockquote>

<p>
Note that the <tt>alias</tt> list can be empty.
</p>

<p>
The more general name resolution function 
<a href=#getaddrinfo><tt>dns.getaddrinfo</tt></a>, which
supports both IPv6 and IPv4,
returns <em>all</em> information obtained from 
the resolver in a table of the form:
</p>

<blockquote><tt>
resolved6 = {<br>
&nbsp;&nbsp;[1] = {<br>
&nbsp;&nbsp;&nbsp;&nbsp;family = <i>family-name-1</i>,<br>
&nbsp;&nbsp;&nbsp;&nbsp;addr = <i>address-1</i><br>
&nbsp;&nbsp;},<br>
&nbsp;&nbsp;...<br>
&nbsp;&nbsp;[n] = {<br>
&nbsp;&nbsp;&nbsp;&nbsp;family = <i>family-name-n</i>,<br>
&nbsp;&nbsp;&nbsp;&nbsp;addr = <i>address-n</i><br>
&nbsp;&nbsp;}<br>
}
</tt> </blockquote>

<p>
Here, <tt>family</tt> contains the string <tt>"inet"</tt> for IPv4
addresses, and <tt>"inet6"</tt> for IPv6 addresses.
</p>

<!-- getaddrinfo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

<p class=name id=getaddrinfo> 
socket.dns.<b>getaddrinfo(</b>address<b>)</b>
</p>

<p class=description>
Converts from host name to address. 
</p>

<p class=parameters>
<tt>Address</tt> can  be an IPv4 or IPv6 address or host name. 
</p>

<p class=return>
The function returns a table with  all  information returned  by
the  resolver.  In  case of error, the function returns <b><tt>nil</tt></b>
followed by an error message.  
</p>

<!-- gethostname ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

<p class=name id=gethostname> 
socket.dns.<b>gethostname()</b>
</p>

<p class=description>
Returns the standard host name for the machine as a string. 
</p>

<!-- tohostname +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

<p class=name id=tohostname> 
socket.dns.<b>tohostname(</b>address<b>)</b>
</p>

<p class=description>
Converts from IPv4 address to host name.
</p>

<p class=parameters>
<tt>Address</tt> can  be an IP address  or host name. 
</p>

<p class=return>
The function returns a string  with the canonic host name of the given
<tt>address</tt>, followed  by a  table with  all  information returned  by
the  resolver.  In  case of error, the function returns <b><tt>nil</tt></b>
followed by an error message.  
</p>

<!-- toip +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

<p class=name id=toip> 
socket.dns.<b>toip(</b>address<b>)</b>
</p>

<p class=description>
Converts from host name to IPv4 address.
</p>

<p class=parameters>
<tt>Address</tt> can  be an IP address  or host name. 
</p>

<p class=return> 
Returns a string  with the first IP address  found for <tt>address</tt>,
followed  by a  table with  all  information returned  by the  resolver.
In  case of error, the function returns <b><tt>nil</tt></b> followed by an error
message. 
</p>

<!-- footer +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

<div class=footer>
<hr>
<center>
<p class=bar>
<a href="index.html">home</a> &middot;
<a href="index.html#down">download</a> &middot;
<a href="installation.html">installation</a> &middot;
<a href="introduction.html">introduction</a> &middot;
<a href="reference.html">reference</a>
</p>
<p>
<small>
Last modified by Diego Nehab on <br>
Thu Apr 20 00:25:07 EDT 2006
</small>
</p>
</center>
</div>

</body>
</html>

Directory Contents

Dirs: 0 × Files: 18

Name Size Perms Modified Actions
4.60 KB lrw-r--r-- 2013-06-14 11:27:32
Edit Download
9.34 KB lrw-r--r-- 2013-06-14 11:27:32
Edit Download
11.18 KB lrw-r--r-- 2013-06-14 11:27:32
Edit Download
7.39 KB lrw-r--r-- 2013-06-14 11:27:32
Edit Download
3.79 KB lrw-r--r-- 2013-06-14 11:27:32
Edit Download
12.14 KB lrw-r--r-- 2013-06-14 11:27:32
Edit Download
10.68 KB lrw-r--r-- 2013-06-14 11:27:32
Edit Download
297.00 KB lrw-r--r-- 2013-06-14 11:27:32
Edit Download
11.46 KB lrw-r--r-- 2013-06-14 11:27:32
Edit Download
13.83 KB lrw-r--r-- 2013-06-14 11:27:32
Edit Download
237 B lrw-r--r-- 2013-06-14 11:27:32
Edit Download
950 B lrw-r--r-- 2013-06-14 11:27:32
Edit Download
7.41 KB lrw-r--r-- 2013-06-14 11:27:32
Edit Download
14.16 KB lrw-r--r-- 2013-06-14 11:27:32
Edit Download
13.54 KB lrw-r--r-- 2013-06-14 11:27:32
Edit Download
20.96 KB lrw-r--r-- 2013-06-14 11:27:32
Edit Download
16.52 KB lrw-r--r-- 2013-06-14 11:27:32
Edit Download
8.23 KB lrw-r--r-- 2013-06-14 11:27:32
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).
© 2026 REDROOM — Secure File Manager. All rights reserved. Built with ❤️ & Red Dark UI