Find External or Internet IP address from Linux and Windows

Find External/Public IP Address using windows

From windows command prompt you can find the internet address of your system or modem address using the following command.

C:\>nslookup myip.opendns.com resolver1.opendns.com
           Server:  resolver1.opendns.com
           Address:  xxx.xxx.xxx.xxx
           Non-authoritative answer:
           Name:    myip.opendns.com
           Address:  xxx.xxx.xxx.xxx

Above command output two ipv4 address. Address shown for myip.opendns.com highlighted will be you external ip or internet/modem ip address.

Find External/Public IP Address using Linux

In linux it can be find using dig command. It will output lost of information. Can be filtered using +shot options.

:~$ dig +short myip.opendns.com @resolver1.opendns.com
  xxx.xxx.xxx.xxx

Command ouptus the your external internet IP address.


Tags: Nslookup, Dig, Public IPv4