aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorRaimo Niskanen <raimo.niskanen@ericsson.com>2010-01-28 17:01:00 +0100
committerBjörn Gustavsson <bjorn@erlang.org>2010-02-09 13:41:42 +0100
commitcc90d8c3642afa626b483b92c53964365d72b35a (patch)
tree64f07e3fe207469ce40a2b55d3e545c213db0091 /erts
parent51bb4c6ae1e4d61304aee5b4bf77279d838da84a (diff)
downloadotp-cc90d8c3642afa626b483b92c53964365d72b35a.tar.gz
otp-cc90d8c3642afa626b483b92c53964365d72b35a.tar.bz2
otp-cc90d8c3642afa626b483b92c53964365d72b35a.zip
inet:gethostbyname improved to parse IP strings and look up own hostname
Now inet:gethostbyname tries to parse the hostname as an IP string first if the 'native' lookup method is not used. One can also make the IP string parsing explicit using the new 'string' lookup method, or avoid it using the new pseudo lookup method 'nostring'. In R13B04 a bug was introduced when the gethostbyname code was rewritten, so if the native resolver was used and misconfigured to not be able to look up the own hostname, inet:gethostbyname also failed. This is now fixed.
Diffstat (limited to 'erts')
-rw-r--r--erts/doc/src/inet_cfg.xml7
1 files changed, 7 insertions, 0 deletions
diff --git a/erts/doc/src/inet_cfg.xml b/erts/doc/src/inet_cfg.xml
index 18cf65759a..d289c42557 100644
--- a/erts/doc/src/inet_cfg.xml
+++ b/erts/doc/src/inet_cfg.xml
@@ -230,6 +230,13 @@
(use the Erlang DNS client
<seealso marker="kernel:inet_res">inet_res</seealso>
for nameserver queries).</p>
+ <p>The lookup method <c><![CDATA[string]]></c> tries to
+ parse the hostname as a IPv4 or IPv6 string and return
+ the resulting IP address. It is automatically tried
+ first when <c><![CDATA[native]]></c> is <em>not</em>
+ in the <c><![CDATA[Methods]]></c> list. To skip it in this case
+ the pseudo lookup method <c><![CDATA[nostring]]></c> can be
+ inserted anywhere in the <c><![CDATA[Methods]]></c> list.</p>
<p></p>
</item>
<tag><em><c><![CDATA[{cache_size, Size}.]]></c></em></tag>