From f37e0260261f7691246429d227cf7124c291e8b1 Mon Sep 17 00:00:00 2001 From: Diego Nehab Date: Tue, 17 Apr 2012 01:15:26 +0800 Subject: 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 --- doc/dns.html | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 56 insertions(+), 5 deletions(-) (limited to 'doc/dns.html') 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 @@

DNS

-Name resolution functions return all information obtained from the -resolver in a table of the form: +IPv4 name resolution functions +dns.toip +and +dns.tohostname +return all information obtained from +the resolver in a table of the form:

-resolved = {
+resolved4 = {
  name = canonic-name,
  alias = alias-list,
  ip = ip-address-list
@@ -55,6 +59,53 @@ resolved = {
Note that the alias list can be empty.

+

+The more general name resolution function +dns.getaddrinfo, which +supports both IPv6 and IPv4, +returns all information obtained from +the resolver in a table of the form: +

+ +
+resolved6 = {
+  [1] = {
+    family = family-name-1,
+    addr = address-1
+  },
+  ...
+  [n] = {
+    family = family-name-n,
+    addr = address-n
+  }
+} +
+ +

+Here, family contains the string "inet" for IPv4 +addresses, and "inet6" for IPv6 addresses. +

+ + + +

+socket.dns.getaddrinfo(address) +

+ +

+Converts from host name to address. +

+ +

+Address can be an IPv4 or IPv6 address or host name. +

+ +

+The function returns a table with all information returned by +the resolver. In case of error, the function returns nil +followed by an error message. +

+

@@ -72,7 +123,7 @@ socket.dns.tohostname(address)

-Converts from IP address to host name. +Converts from IPv4 address to host name.

@@ -93,7 +144,7 @@ socket.dns.toip(address)

-Converts from host name to IP address. +Converts from host name to IPv4 address.

-- cgit v1.2.3-55-g6feb