luasocket/doc/dns.html

133 lines
3.3 KiB
HTML
Raw Normal View History

2003-08-31 03:00:15 +02:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
2004-06-21 08:07:58 +02:00
<meta name="description" content="LuaSocket: DNS support">
<meta name="keywords" content="Lua, LuaSocket, DNS, Network, Library, Support">
2004-06-21 08:07:58 +02:00
<title>LuaSocket: DNS support</title>
2003-08-31 03:00:15 +02:00
<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">
2004-06-21 08:07:58 +02:00
<img width=128 height=128 border=0 alt="LuaSocket" src="luasocket.png">
2003-08-31 03:00:15 +02:00
</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;
2004-12-13 07:26:01 +01:00
<a href="installation.html">installation</a> &middot;
2003-08-31 03:00:15 +02:00
<a href="introduction.html">introduction</a> &middot;
<a href="reference.html">reference</a>
</p>
</center>
<hr>
</div>
<!-- dns ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<h2 id=dns>DNS</h2>
<p>
2004-06-16 06:28:21 +02:00
Name resolution functions return <em>all</em> information obtained from the
2003-08-31 03:00:15 +02:00
resolver in a table of the form:
</p>
<blockquote><tt>
resolved = {<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>
<!-- gethostname ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<p class=name id=gethostname>
socket.dns.<b>gethostname()</b>
</p>
<p class=description>
2004-06-16 06:28:21 +02:00
Returns the standard host name for the machine as a string.
</p>
2003-08-31 03:00:15 +02:00
<!-- tohostname +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<p class=name id=tohostname>
2004-06-16 01:00:56 +02:00
socket.dns.<b>tohostname(</b>address<b>)</b>
2003-08-31 03:00:15 +02:00
</p>
<p class=description>
Converts from IP address to host name.
</p>
<p class=parameters>
<tt>Address</tt> can be an IP address or host name.
</p>
<p class=return>
2004-05-25 08:51:43 +02:00
The function returns a string with the canonic host name of the given
2003-08-31 03:00:15 +02:00
<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>
2003-08-31 03:00:15 +02:00
followed by an error message.
</p>
<!-- toip +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<p class=name id=toip>
2004-06-16 01:00:56 +02:00
socket.dns.<b>toip(</b>address<b>)</b>
2003-08-31 03:00:15 +02:00
</p>
<p class=description>
Converts from host name to IP 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
2003-08-31 03:00:15 +02:00
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;
2004-12-13 07:26:01 +01:00
<a href="installation.html">installation</a> &middot;
2003-08-31 03:00:15 +02:00
<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
2003-08-31 03:00:15 +02:00
</small>
</p>
</center>
</div>
</body>
</html>