Use of http:request

Greg Smyth <>
Thu Jan 14 16:59:42 CET 2010


Hi all,

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:-

5> inet:gethostbyname("webserver001.cluster1.company.com").
{ok,{hostent,"webserver001.cluster1.company.com",[],inet,4,
             [{10,129,21,101}]}}
6> http:request("http://webserver001.cluster1.company.com").
{error,nxdomain}

other addresses (such as google.com), seem to request fine, as does
requesting directly via IP:-

7> http:request("http://10.129.21.101").
{ok,{{"HTTP/1.1",200,"OK"},
     [{"cache-control",
<snipped...>

I've checked my /etc/hosts file - no entries in there apart from localhost....

Any ideas?

Cheers,
Greg


More information about the erlang-questions mailing list