How do I find my own IP address?

Björn Bylander <>
Thu Jan 22 17:44:10 CET 2004

Samuel Rivas wrote:

> If the name of possible interfaces bothers you, there is another
> (and undocumented too) function that will return an interesting list:
> 1> inet:getiflist(S).
> {ok,["lo","eth0"]}
> The real problem is those functions are not in the public API, so they
> could be changed in future releases.
> Finally I've no idea of how Windows names its interfaces, and no
> chance to test getiflist in a Windows host ...

Results from a Windows machine:

Erlang (BEAM) emulator version 5.3 [threads:0]

Eshell V5.3  (abort with ^G)
1> {ok, S} = inet_udp:open(0, []).
2> inet:getiflist(S).

The IP addresses on this machine are (of course) and


More information about the erlang-questions mailing list