[erlang-questions] receiving pang from net_adm:ping/1 even though net_adm:names/0 shows the other node

Dennis Byrne <>
Sun Apr 19 19:30:24 CEST 2009


On Sun, Apr 19, 2009 at 12:18 PM, Per Melin <> wrote:
> On Sun, Apr 19, 2009 at 7:03 PM, Dennis Byrne <> wrote:
>> $ erl -name bar -setcookie c
>> ()1> net_adm:names().
>> {error,nxdomain}
>
> nxdomain means non-existing domain, which I guess means that your
> machine's DNS name isn't actually 207.hyperband.com. Can that be
> correct?

I thought this as well but if you will notice though, the bar node has
no problem pinging itself using this domain.  You are correct though
because I cannot even ping the machine using a standard ping outside
of erlang.

$ ping 207.hyperband.com
ping: cannot resolve 207.hyperband.com: Unknown host

One more thing to note.  In syslog I can see that my ISP is setting my
hostname to 207.230.10.129.ip.anet.com .  I can ping my machine
(outside of erlang) using this:

$ ping 207.230.10.129.ip.anet.com
PING 207.230.10.129.ip.anet.com (207.230.10.129): 56 data bytes
64 bytes from 207.230.10.129: icmp_seq=0 ttl=64 time=0.038 ms

But ping fails using this hostname within Erlang.

()6> net_adm:ping('').
pang

> Try starting both nodes with -sname. That doesn't require a valid hostname.

This is what I did in the original post, starting the nodes with $ erl
-sname foo -setcookie c and $ erl -sname bar -setcookie c .

-- 
Dennis Byrne



More information about the erlang-questions mailing list