Hostwinds Blog
Search results for:
Your server's IP address is needed for managing your website, setting up remote access, troubleshooting connectivity, and more.
Whether you're using a Windows, Linux, or macOS system, there are a number of simple ways to quickly locate your server's IP address.
This guide will go over the different methods you can use.
A server's IP address is a unique identifier that allows devices to connect over a network. It can be either public (used to communicate over the internet) or private (used within a local network).
Knowing your server's IP address helps with configuring DNS settings, managing security rules, and accessing the server remotely.
Learn More: What is an IP Address
Your public IP address is what the rest of the internet sees when your server communicates externally.
It's the address you'll use for things like pointing a domain name to your server, setting up firewall rules, or remote connections like SSH or RDP.
Here are a few ways to find your server's public IP address:
This is one of the fastest and most user-friendly ways to discover your public IP address:
This method is especially useful for quickly checking your IP without needing technical commands or tools.
If your server is hosted with a web hosting company, they should display the server's public IP address in their management interface:
This is a reliable method since it displays the correct address even if your server setup has multiple interfaces or IPs.
If you prefer to use the command line interface (CLI), there are several simple commands for getting your public IP address.
On Linux or macOS:
Option 1:
curl ifconfig.me
This command sends a request to a service that returns your public IP.
Option 2:
curl -s checkip.dyndns.org | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+'
This grabs the IP from the HTML response provided by checkip.dyndns.org.
On Windows (PowerShell):
(Invoke-WebRequest ifconfig.me/ip).Content.Trim()
This pulls the IP address using PowerShell. It works similarly to the Linux command above but tailored for Windows users.
A private IP address is used within a private network (for example, between your server and a local router or other internal machines).
It's good to know your private IP address when working within a virtual private cloud (VPC), configuring internal firewalls, or for troubleshooting local connections.
ipconfig
Look for the line labeled IPv4 Address under the appropriate network adapter. This is your server's private IP.
Option 1:
ip a
Locate your active network interface (commonly named eth0, ens33, or wlan0). The private IP address is typically listed after inet and looks something like 192.168.x.x or 10.x.x.x.
Option 2:
hostname -I
This will return the internal IP addresses assigned to your server.
ipconfig getifaddr en0
Tip: If you're on a wired connection and it doesn't return anything, try replacing en0 with en1 or another interface name depending on your setup.
Written by Hostwinds Team / April 14, 2025