aboutsummaryrefslogtreecommitdiff
path: root/doc/dns.html
diff options
context:
space:
mode:
authorDiego Nehab <diego.nehab@gmail.com>2012-04-17 01:15:26 +0800
committerDiego Nehab <diego.nehab@gmail.com>2012-04-17 01:15:26 +0800
commitf37e0260261f7691246429d227cf7124c291e8b1 (patch)
tree7e84322c8852d4227e36958af1132a4588f64795 /doc/dns.html
parentb3c4f46179ed5b27ca76a824f8730fa50dbaae0b (diff)
downloadluasocket-f37e0260261f7691246429d227cf7124c291e8b1.tar.gz
luasocket-f37e0260261f7691246429d227cf7124c291e8b1.tar.bz2
luasocket-f37e0260261f7691246429d227cf7124c291e8b1.zip
First stab at documenation
Update Lua and Luasocket version in samples and in documentation Documented ipv5_v6only default option being set Documented tcp6 and udp6 Documented dns.getaddrinfo Documented zero-sized datagram change? Documented getoption
Diffstat (limited to 'doc/dns.html')
-rw-r--r--doc/dns.html61
1 files changed, 56 insertions, 5 deletions
diff --git a/doc/dns.html b/doc/dns.html
index a38e368..c4a0472 100644
--- a/doc/dns.html
+++ b/doc/dns.html
@@ -39,12 +39,16 @@
39<h2 id=dns>DNS</h2> 39<h2 id=dns>DNS</h2>
40 40
41<p> 41<p>
42Name resolution functions return <em>all</em> information obtained from the 42IPv4 name resolution functions
43resolver in a table of the form: 43<a href=#toip><tt>dns.toip</tt></a>
44and
45<a href=#tohostname><tt>dns.tohostname</tt></a>
46return <em>all</em> information obtained from
47the resolver in a table of the form:
44</p> 48</p>
45 49
46<blockquote><tt> 50<blockquote><tt>
47resolved = {<br> 51resolved4 = {<br>
48&nbsp;&nbsp;name = <i>canonic-name</i>,<br> 52&nbsp;&nbsp;name = <i>canonic-name</i>,<br>
49&nbsp;&nbsp;alias = <i>alias-list</i>,<br> 53&nbsp;&nbsp;alias = <i>alias-list</i>,<br>
50&nbsp;&nbsp;ip = <i>ip-address-list</i><br> 54&nbsp;&nbsp;ip = <i>ip-address-list</i><br>
@@ -55,6 +59,53 @@ resolved = {<br>
55Note that the <tt>alias</tt> list can be empty. 59Note that the <tt>alias</tt> list can be empty.
56</p> 60</p>
57 61
62<p>
63The more general name resolution function
64<a href=#getaddrinfo><tt>dns.getaddrinfo</tt></a>, which
65supports both IPv6 and IPv4,
66returns <em>all</em> information obtained from
67the resolver in a table of the form:
68</p>
69
70<blockquote><tt>
71resolved6 = {<br>
72&nbsp;&nbsp;[1] = {<br>
73&nbsp;&nbsp;&nbsp;&nbsp;family = <i>family-name-1</i>,<br>
74&nbsp;&nbsp;&nbsp;&nbsp;addr = <i>address-1</i><br>
75&nbsp;&nbsp;},<br>
76&nbsp;&nbsp;...<br>
77&nbsp;&nbsp;[n] = {<br>
78&nbsp;&nbsp;&nbsp;&nbsp;family = <i>family-name-n</i>,<br>
79&nbsp;&nbsp;&nbsp;&nbsp;addr = <i>address-n</i><br>
80&nbsp;&nbsp;}<br>
81}
82</tt> </blockquote>
83
84<p>
85Here, <tt>family</tt> contains the string <tt>"inet"</tt> for IPv4
86addresses, and <tt>"inet6"</tt> for IPv6 addresses.
87</p>
88
89<!-- getaddrinfo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
90
91<p class=name id=getaddrinfo>
92socket.dns.<b>getaddrinfo(</b>address<b>)</b>
93</p>
94
95<p class=description>
96Converts from host name to address.
97</p>
98
99<p class=parameters>
100<tt>Address</tt> can be an IPv4 or IPv6 address or host name.
101</p>
102
103<p class=return>
104The function returns a table with all information returned by
105the resolver. In case of error, the function returns <b><tt>nil</tt></b>
106followed by an error message.
107</p>
108
58<!-- gethostname ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> 109<!-- gethostname ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
59 110
60<p class=name id=gethostname> 111<p class=name id=gethostname>
@@ -72,7 +123,7 @@ socket.dns.<b>tohostname(</b>address<b>)</b>
72</p> 123</p>
73 124
74<p class=description> 125<p class=description>
75Converts from IP address to host name. 126Converts from IPv4 address to host name.
76</p> 127</p>
77 128
78<p class=parameters> 129<p class=parameters>
@@ -93,7 +144,7 @@ socket.dns.<b>toip(</b>address<b>)</b>
93</p> 144</p>
94 145
95<p class=description> 146<p class=description>
96Converts from host name to IP address. 147Converts from host name to IPv4 address.
97</p> 148</p>
98 149
99<p class=parameters> 150<p class=parameters>