title: localhost doesn't resolve to 127.0.0.1
body: <p>I make a call to <code>Inet4Address.getByName("localhost")</code> expecting to see <code>127.0.0.1</code>, but instead I see my IP assigned to my ethernet/airport.  If I disconnect my ethernet/airport, I will get the resolution of <code>127.0.0.1</code>, but as soon as I connect again it resolves to the IP address of the ethernet/airport.</p>
  
  <p>I'm using OSX 10.6.7 and java version "1.6.0_24".  My /etc/hosts file has <code>"127.0.0.1 localhost"</code>.  Ping localhost in the terminal does resolve to 127.0.0.1.</p>
  
  <p>The reason I need this is that I'm doing GWT development where I have a different JVM trying to make a call to GWT Hosted Mode, and I get a ConnectionException: connection refused, if localhost doesn't resolve to 127.0.0.1.</p>
  
  <p>Thanks  </p>