28 July 20252025-07-28T00:00:00.000ZFind your external public IP address from a Unix or Linux terminal with a single dig command querying Cloudflare's whoami resolver, handy when behind NAT.how-to, linux
Find your external public IP address from a Unix or Linux terminal with a single dig command querying Cloudflare's whoami resolver, handy when behind NAT.
If you’re using a Unix or Linux terminal and you need to know what your external IP address is (e.g. if you’re behind NAT) then there’s a quick one-liner that will do it for you:
dig +short txt ch whoami.cloudflare @1.0.0.1
Simply type this in and hit return and it will display a line of text with your external public IP address.
Related Services
Need support with this in your environment?
These services cover the same kinds of issues discussed in this article.
Comments