Public | Automated Build

Last pushed: 2 years ago
Short Description
A small tool that returns your current local or remote IP address
Full Description


A small tool that returns your current local or remote IP addresses

myip is a tiny, cross-platform command-line utility that just returns your current IP address (local or remote) for Linux, Windows and Mac.


Of course there are many ways to determine your current local or remote IP address. But all of them (afaik) require some scripting and string extraction and would not work the same way on all platforms.

I created this really simple tool to do just that: Get the current IP address - on all operating systems.


myip <action> [options]


  • local: Get your local IP address
  • remote: Get your remote IP address


  • -4: Use IPv4 instead of IPv6 (optional)
  • -select: Select one or more IPs (optional)
    • all: Returns all IP addresses
    • first: Returns only the first IP address
    • last: Returns only the last IP address
    • 2: Return only the second IP address
    • 1,2,3: Return only the first three IP addresses
    • 3,2,1: Return only the first three IP addresses in reverse order
    • 3: Return only the third IP address

Get Help

Get help and usage information:



myip -h

Get the current local IP(s)

Get the current local IP addresses:

myip local

Get only the first local IP address:

myip local -select first


myip local -select 1

Get the current remote IP(s)

Get the current remote IP address:

myip remote

IPv6 vs. IPv4

myip will only return IPv6 addresses by default. If you want myip to return an IPv4 address you must add the -4 flag.


myip local -4
myip remote -6


If you have go installed:

git clone && cd myip-cli
go run make.go -install


go get


You can use to included make.go-script to cross-compile myip for darwin, linux and windows (amd64, arm, arm5, arm6, arm7):

go run make.go -crosscompile

If you don't have golang installed but have docker instead you can use docker to build/cross-compile myip:

git clone && cd myip-cli
docker run \
       --rm \
       -v `pwd`:/go/src/ \
       --workdir=/go/src/ \
       golang:latest \
       make crosscompile

Or you can extract the binaries from the automatically built andreaskoch/myip-cli docker image:

docker run --rm -v `pwd`:/exchange andreaskoch/myip-cli:latest bash -c "cp -a /go/src/* /exchange"

↑ This command will copy the binaries from the docker container to your current directory.


myip-cli uses for determining your local and remote IP addresses.

Docker Pull Command
Source Repository