fromName() with localHostName() returns incomplete address list
Hello,
I am trying to get all local addresses on the host. I issue this call:
But the resulting list has only one entry, "127.0.1.1", even though I have a running ethernet connection with its own IP. At the very least the list should have two entries, "127.0.1.1" and the NIC's IP.
Does anybody have an idea what's wrong?
Re: fromName() with localHostName() returns incomplete address list
Found the cause. Debian and Ubuntu associate the hostname with 127.0.0.1 or 127.0.1.1 in the /etc/hosts file. This limits the lookup to these addresses.
Unfortunately, there seems to be no way around this :(