[erlang-questions] Use of http:request

Tomas Abrahamsson tomas.abrahamsson@REDACTED
Thu Jan 14 23:52:01 CET 2010


> I'm having a bit of a problem understanding why http:request is
> returning "{error,nxdomain}" - whenever the box seems to resolve
> properly via inet:gethostbyname:-

What version of Erlang are you running?

This has happened to me with R12B-5 (inets-5.0.12), I think, but I cannot
reproduce it with the R13B02 (inets-5.1.3) I currently have at hand.

The problem in my case was that the web server had both an ipv6
address and an ipv4 address, and I didn't have any ipv6 networking
properly set up, and the http:request in R12B-5 by default tried first ipv6
then ipv4. So it found an ipv6 address, couldn't reach it and ended up
with an {error,enetunreach}.

You could try to run "dig AAAA webserver001.cluster1.company.com"
or inet:gethostbyname("webserver001.cluster1.company.com", inet6).
to see if it has an ipv6 address. In my case it was the www.ida.liu.se
that I tried to reach.

If this is the problem for you, then you may try
http:set_options([{ipv6,disabled}]).

BRs
Tomas


More information about the erlang-questions mailing list