Issue Type: Bug Bug
Assignee: Thomas E Enebo
Created: 16/Apr/13 11:28 AM
Description:

Socket.gethostname() returns "0.0.0.0" dns cannot resolve the hostname.

Which is kind of odd

So, here's what I know - When 'Socket.gethostname' is invoked, JRuby does a dns request for the hostname of the server. If that dns request returns NXDOMAIN, Socket.gethostname reports 0.0.0.0.

The weirdest part about this is that it does a dns request for the hostname that I"m asking for. Here's some tcpdump showing it happening:

% ruby -rsocket -e 'puts Socket.gethostname'
0.0.0.0
09:27:33.705005 IP 127.0.0.1.60310 > 127.0.1.1.53: 48273+ AAAA? sadness. (25)
09:27:33.705071 IP 192.168.1.103.13241 > 192.168.1.1.53: 3049+ AAAA? sadness. (25)
09:27:33.716733 IP 192.168.1.1.53 > 192.168.1.103.13241: 3049 NXDomain 0/1/0 (100)
09:27:33.716892 IP 127.0.1.1.53 > 127.0.0.1.60310: 48273 NXDomain 0/1/0 (100)
09:27:33.716976 IP 127.0.0.1.40985 > 127.0.1.1.53: 38863+ A? sadness. (25)
09:27:33.717005 IP 192.168.1.103.11594 > 192.168.1.1.53: 30913+ A? sadness. (25)
09:27:33.731331 IP 192.168.1.1.53 > 192.168.1.103.11594: 30913 NXDomain 0/1/0 (100)
09:27:33.731481 IP 127.0.1.1.53 > 127.0.0.1.40985: 38863 NXDomain 0/1/0 (100)
09:27:33.732950 IP 127.0.0.1.36516 > 127.0.1.1.53: 42298+ PTR? 0.0.0.0.in-addr.arpa. (38)
09:27:33.733004 IP 192.168.1.103.22319 > 192.168.1.1.53: 21269+ PTR? 0.0.0.0.in-addr.arpa. (38)
09:27:33.748471 IP 192.168.1.1.53 > 192.168.1.103.22319: 21269 NXDomain 0/1/0 (106)
09:27:33.748553 IP 127.0.1.1.53 > 127.0.0.1.36516: 42298 NXDomain 0/1/0 (106)

"sadness" is the name of this workstation and is the string returned by the hostname(1) command and the same value given by gethostname(3).

Project: JRuby
Priority: Major Major
Reporter: Jordan Sissel
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

Reply via email to