title: gethostbyname() only returns the address of local host on linux
body: <p>I'm trying to portably (Windows &amp; Linux) find all of the IP addresses of the local machine. The method I am using is to first call gethostname(), and then pass the result of that to gethostbyname(), which returns an array of ip addresses.</p>
  
  <p>The problem is that on linux, the only address I get back is 127.0.0.1. This works on Windows, and I've seen a few people state that this will not work on Linux if your network was configured by DHCP (don't know if that's a true statement).</p>
  
  <p>Is this not the correct way to do this on Linux?</p>