title: Python3 socket: socket.gethostbyname_ex at Ubuntu 16.06
body: <p>I'm using the socket module to get the IP address of a device automatically. I tried my code under Ubuntu 16.06 and it doesn't work anymore. I guess that this is connected to some changes. While "ifconfig" doesn't work anymore, I use "ip addr show" to get the IP address.</p>
  
  <p>Until now I used the following lines:</p>
  
  <pre><code># tuple of ips from all network interfaces
  ips = socket.gethostbyname_ex(socket.gethostname())
  </code></pre>
  
  <p>Does someone has experience with it? I really would like to keep on using "socket" instead a workaround. 
  But I was thinking about to call "ip addr show" and to parse the output from the command line.</p>
  
  <p>Any ideas?</p>
  
  <p>Alex</p>