title: Why does gethostbyaddr(gethostname()) return my IPv6 IP?
body: <p>I'm working on making a simple server application with python, and I'm trying to get the IP to bind the listening socket to. An example I looked at uses this: </p>
  
  <pre><code>HOST = gethostbyaddr(gethostname())
  </code></pre>
  
  <p>With a little more processing after this, it should give me just the host IP as a string. This should return the IPv4 address. But when I run this code, it returns my IPv6 address. Why does it do this and how can I get my IPv4 address?</p>
  
  <p>If its relevant, I'm using windows vista and python 2.5</p>