From: Kevin Brown Date: 2005-12-09T00:51:43+09:00 Subject: Re: DRb connection issues Thanks for the reply! On Wednesday 07 December 2005 18:13, Eric Hodel wrote: >[...] > Your ping host names and druby URI host names do not match. Try ping > with the full host name. kevin@nicaragua:~$ ping costarica.fylz.com PING costarica.fylz.com (192.168.2.105) 56(84) bytes of data. 64 bytes from costarica.fylz.com (192.168.2.105): icmp_seq=1 ttl=64 time=0.317 ms kevin@costarica:~$ ping nicaragua.fylz.com PING nicaragua.fylz.com (192.168.2.102) 56(84) bytes of data. 64 bytes from nicaragua.fylz.com (192.168.2.102): icmp_seq=1 ttl=64 time=0.183 ms > On each machine try: > $ ruby -rsocket -e 'p Socket.gethostname' > "kaa.coop.robotcoop.com > $ ruby -rsocket -e 'p Socket.gethostbyname("kaa.coop.robotcoop.com")' > ["kaa.coop.robotcoop.com", [], 2, "\300\250\001F"] > $ ruby -rsocket -e 'p Socket.gethostbyaddr("\300\250\001F")' > ["kaa.coop.robotcoop.com", [], 2, "\300\250\001F"] > $ ruby -rsocket -e 'p Socket.gethostbyname("rur-1.coop.robotcoop.com")' > ["rur-1.coop.robotcoop.com", [], 2, "\300\250\001\v"] > $ ruby -rsocket -e 'p Socket.gethostbyaddr("\300\250\001\v")' > ["rur-1.coop.robotcoop.com", [], 2, "\300\250\001\v"] > > Where 'kaa.coop.robotcoop.com' is the local machine and > 'rur-1.coop.robotcoop.com' is the remote machine. == Server == kevin@costarica:~$ ruby -rsocket -e 'p Socket.gethostname' "costarica.fylz.com" kevin@costarica:~$ ruby -rsocket -e 'p Socket.gethostbyname("costarica.fylz.com")' ["costarica.fylz.com", ["localhost.localdomain", "localhost", "costarica", "costarica"], 2, "\177\000\000\001", "\300\250\002i"] kevin@costarica:~$ ruby -rsocket -e 'p Socket.gethostbyaddr("\300\250\002i")' ["costarica.fylz.com", ["costarica"], 2, "\300\250\002i"] kevin@costarica:~$ ruby -rsocket -e 'p Socket.gethostbyname("nicaragua.fylz.com")' ["nicaragua.fylz.com", ["nicaragua"], 2, "\300\250\002f"] kevin@costarica:~$ ruby -rsocket -e 'p Socket.gethostbyaddr("\300\250\002f")' ["nicaragua.fylz.com", ["nicaragua"], 2, "\300\250\002f"] == Client == kevin@nicaragua:~$ ruby -rsocket -e 'p Socket.gethostname' "nicaragua.fylz.com" kevin@nicaragua:~$ ruby -rsocket -e 'p Socket.gethostbyname("nicaragua.fylz.com")' ["nicaragua.fylz.com", ["localhost.localdomain", "localhost", "nicaragua", "nicaragua"], 2, "\177\000\000\001", "\300\250\002f"] kevin@nicaragua:~$ ruby -rsocket -e 'p Socket.gethostbyaddr("\300\250\002f")' ["nicaragua.fylz.com", ["nicaragua"], 2, "\300\250\002f"] kevin@nicaragua:~$ ruby -rsocket -e 'p Socket.gethostbyname("costarica.fylz.com")' ["costarica.fylz.com", ["costarica"], 2, "\300\250\002i"] kevin@nicaragua:~$ ruby -rsocket -e 'p Socket.gethostbyaddr("\300\250\002i")' ["costarica.fylz.com", ["costarica"], 2, "\300\250\002i"] > Line 1 should match `hostname` It does. > Lines 2 and 3 should be identical They're obviously not. So what do I change to get them to be? > Lines 4 and 5 should be identical They are. > In lines 2 through 5 the last item should not match: > "\177\000\000\001" It's not the last item, but is there. And just to make sure that it's still happening, I tried running the dchats and dchatc programs again and got the same error. > Note: > > "\177\000\000\001".scan(/./).map { |c| c[0] }.join '.' > => "127.0.0.1" Makes sense. > > And here are the contents of both of their /etc/hosts files: > > > > kevin@nicaragua:~/ruby/drb$ cat /etc/hosts > > I would set up DNS instead of relying on hosts files, I've found > hosts files fragile.