title: In Ruby, how does one get their IP octet without going through DNS?
body: <p>I can, on some of my systems, get my IP address (192.68.m.n format) by doing this:</p>
  
  <pre><code>addr = IPSocket::getAddress(Socket.gethostname())
  </code></pre>
  
  <p>...the trouble is that this only works if the name the local machine uses for itself is the name the DNS server associates with it.</p>
  
  <p>How *&amp;#( hard can it be for ruby to just return its primary interface's IP address?  I have to do this in a platform-independant way or I'd just call ifconfig or ipconfig and parse it.</p>