ipconfig.co.uk

Find my IP address: public and local, on every platform

There are two answers to "what is my IP". The one your router presents to the internet, and the one your device has on the local network. Websites, including this one, can only see the first. Your operating system's commands only show the second.

Your public IPv4 address, as seen by this server
216.73.216.111
You reached this page over IPv4. If your network has IPv6, curl -6 ipconfig.co.uk/ip shows that address. If you use a VPN or proxy, this is the VPN\'s address, not yours.

From the command line

This site serves a plain-text endpoint for scripts, in the same spirit as ifconfig.me and icanhazip.com. It returns only the address, with a trailing newline, and does not log or store anything beyond ordinary web-server access logs.

Linux · Terminal
curl ipconfig.co.uk/ip
curl -4 ipconfig.co.uk/ip          # force IPv4
curl -6 ipconfig.co.uk/ip          # force IPv6
curl ipconfig.co.uk/ip/json        # {"ip": "...", "family": "IPv4", ...}
wget -qO- ipconfig.co.uk/ip
# without curl: ask a DNS server which address it sees you from
dig +short myip.opendns.com @resolver1.opendns.com
dig +short txt ch whoami.cloudflare @1.1.1.1

Public vs local: why they differ

Almost every home and office network sits behind NAT (network address translation). Your router has one public address from your ISP. Every device inside has a private address (192.168.x.x, 10.x.x.x or 172.16–31.x.x) that the router rewrites on the way out. So ipconfig shows 192.168.1.42 while the internet sees 81.x.x.x. With IPv6 there is usually no NAT: the global address shown by ipconfig or ip -6 addr is the same one the internet sees, which is why the box above may match your local IPv6 address exactly.

Some ISPs put a second layer of NAT in their own network (carrier-grade NAT). The tell-tale sign is a router WAN address in 100.64.0.0/10 or in a private range, while the box above shows something else. In that case you cannot accept inbound connections (port forwarding, self-hosting) without asking the ISP for a real public address or using a tunnel.

Find your local IP address

Windows · Command Prompt
ipconfig
ipconfig | findstr /i "IPv4"
Windows · PowerShell
(Get-NetIPAddress -AddressFamily IPv4 | Where-Object { $_.InterfaceAlias -notmatch 'Loopback' -and $_.PrefixOrigin -ne 'WellKnown' }).IPAddress
Get-NetIPConfiguration | Where-Object IPv4DefaultGateway | Select-Object -ExpandProperty IPv4Address

Graphically: Settings › Network & internet › Wi-Fi or Ethernet › the network › Properties, scroll to IPv4 address. Or click the network icon in the tray › Properties. Full ipconfig reference →

Find another device's IP address on your network

Windows · Command Prompt
arp -a                              # devices you have talked to recently, with MAC addresses
ping -a 192.168.1.10                # reverse-resolve a name
nslookup printer                    # if the router registers DHCP names
for /L %i in (1,1,254) do @ping -n 1 -w 100 192.168.1.%i | find "TTL="   # crude sweep

The router's DHCP client list is usually the fastest source, and it shows hostnames. Devices on Wi-Fi with "client isolation" enabled will not appear in ARP scans.

Find your MAC address

Any shell
ipconfig /all                          # Windows: Physical Address
getmac /v                              # Windows
ip link                                # Linux: link/ether
cat /sys/class/net/enp3s0/address      # Linux
ifconfig en0 | grep ether              # macOS
networksetup -getmacaddress en0        # macOS

Phones and macOS 15+ randomise the Wi-Fi MAC per network by default, so the address the router sees may differ from the hardware address printed in Settings › About.

Find your DNS servers

Any shell
ipconfig /all | findstr /c:"DNS Servers"     # Windows
Get-DnsClientServerAddress                    # PowerShell
resolvectl status                             # Linux (systemd-resolved)
cat /etc/resolv.conf                          # Linux (other)
scutil --dns | grep nameserver                # macOS

To see which resolver actually answers your queries after all the layers (browser DoH, VPN, router forwarder), query a name that reports the resolver: dig +short whoami.akamai.net, or visit a DNS leak test site.

Related pages

Last reviewed . Command syntax verified against Windows 11, Ubuntu 24.04, macOS 15 and FreeBSD 14 unless noted otherwise.

Spotted a mistake or a switch we have missed? Every page on this site is written to be checked against real output, so please test on your own machine and compare.