What is my IP address?

Question

I need to add an inbound rule to the aws security group that allows my IP to access port 8080. How do I know what is my IP?

Answer

Here are the commands to find your public IP address using various methods on different operating systems:

On Windows:

  1. Using nslookup:

    nslookup myip.opendns.com resolver1.opendns.com

     

  2. Using PowerShell:

    (Invoke-WebRequest -uri "http://ifconfig.me").Content

     

On macOS and Linux:

  1. Using dig:

    dig +short myip.opendns.com @resolver1.opendns.com

     

  2. Using curl:

     

  3. Using wget:

     

On All Systems:

  1. Using Web Services:

These commands will help you find your public IP address from various environments and tools.