Try socket.getaddrinfo rather than socket.gethostbyname. It returns a list of tuples. tuple[4][0] of each list element is the IP address. addrs = socket.getaddrinfo(socket.gethostname(), None) for addr in addrs: print addr[4][0] The above worked on my machine but I only have one NIC card. - Steve