Your IP & Privacy
Get Your IP from the Terminal
One-line commands to print your public IP from a shell — handy on headless servers and in scripts.
curl
curl ifconfig.mecurl (IPv4)
curl -4 https://api.ipify.orgcurl (IPv6)
curl -6 https://api6.ipify.orgcurl (JSON)
curl https://ipapi.co/json/dig
dig +short myip.opendns.com @resolver1.opendns.comdig (Google)
dig +short TXT o-o.myaddr.l.google.com @ns1.google.comhost
host myip.opendns.com resolver1.opendns.comPowerShell
(Invoke-RestMethod ifconfig.me/ip)wget
wget -qO- https://api.ipify.org📖 New to this? Read What Is an IP Address? A Complete Beginner's Guide.