How-to

How to Find Your IP Address on Linux

Last updated July 4, 2026

To find your IP address on Linux, open a terminal and run ip a (or hostname -I) to see your local address, and curl ifconfig.me to see your public one. The commands work on every major distribution, and our checker shows your public IPv4 and IPv6 in a browser.

Those are two different addresses: the local (private) IP assigned on your network and the public IP the internet sees (public vs private IP addresses explains the split). Everything below works on Ubuntu, Debian, Fedora, Arch and virtually every other distribution.

Find your public IP address (instant)

The simplest way to see your public IP is to open our What Is My IP Address tool in a browser. It shows your public IPv4 and IPv6 address, location and ISP instantly, with no logging. Prefer the command line? See the terminal method below.

Find your local IP address via the terminal

Open a terminal and use the modern iproute2 tooling:

  • ip addr show (or just ip a): read the inet line under your active interface, e.g. eth0 or wlan0.
  • hostname -I: prints just your local IP address(es), space-separated.
  • ip route get 1.1.1.1: shows which interface and source IP your traffic actually uses.

The older ifconfig command still works if net-tools is installed, but ip is the current standard.

Find your public IP address from the terminal

One short command queries an external service and prints your public address:

  • curl ifconfig.me
  • curl -4 icanhazip.com: forces IPv4; use -6 for IPv6.
  • dig +short myip.opendns.com @resolver1.opendns.com: a DNS-based lookup.

Find your local IP via the desktop

If you are on a GNOME desktop and prefer a GUI:

  1. Open Settings.
  2. Select Network (wired) or Wi-Fi.
  3. Click the gear ⚙ icon next to your connection to see the IPv4 Address.

Find your IPv6 address on Linux

Run ip -6 addr to list only IPv6 addresses. Look for inet6 lines marked scope global: those are your routable addresses. Lines with scope link (starting fe80::) only work on the local network segment.

Most distributions enable IPv6 privacy extensions (RFC 4941), so you will usually see a stable address plus one or more marked temporary. The temporary ones rotate periodically and are preferred for outgoing connections, which is why the address a website sees may not be the first one in your list. Confirm the public IPv6 your traffic presents with curl -6 icanhazip.com or our IP checker.

Find your router's IP address (default gateway)

Run ip route | grep default. The address after default via is your router, usually 192.168.1.1 or 192.168.0.1. Our how to find your router's IP address guide explains what to do with it.

Troubleshooting: wrong or confusing addresses

Too many interfaces. If you run Docker or virtual machines, ip a is cluttered with virtual interfaces: docker0 (usually 172.17.0.1), veth… pairs, br-… bridges and libvirt's virbr0. None of them is your LAN address. The reliable filter is ip route get 1.1.1.1, which prints the interface and src address your real traffic uses.

hostname -I prints several addresses. It lists every configured address on every interface, including those virtual bridges and IPv6, in no meaningful order. Treat it as a quick dump, not an answer; when it matters, identify the active interface first.

Two network managers. Desktop distributions typically manage connections with NetworkManager (nmcli device show shows per-device addresses and gateways), while servers often use systemd-networkd (networkctl status). If the GNOME Network panel looks empty or ignores your interface, it is probably managed by the other service, so check there before assuming the connection is down.

Frequently Asked Questions

How do I find my IP address in the Linux terminal?
Run ip a (short for ip addr show) and read the inet line under your active interface, such as eth0 or wlan0. If you just want the address with no other output, hostname -I prints every configured address on one line.
What is the difference between ip addr and ifconfig?
ifconfig comes from the deprecated net-tools package and is no longer installed by default on most distributions. ip addr is its replacement from iproute2, shows the same information and more, and is the command current documentation assumes.
Why does hostname -I show multiple IP addresses?
It prints every address on every interface: your real LAN address, Docker and libvirt bridge addresses like 172.17.0.1 or 192.168.122.1, VPN tunnels, and IPv6 addresses. To find the one your internet traffic uses, run ip route get 1.1.1.1 and read the src field.
How do I check my public IP from the Linux command line?
Query an outside service: curl ifconfig.me or curl icanhazip.com print the address your traffic arrives from. Add -4 or -6 to force IPv4 or IPv6. A DNS-based option is dig +short myip.opendns.com @resolver1.opendns.com.
What is the docker0 interface in my ip addr output?
docker0 is a virtual bridge Docker creates for containers, usually with the address 172.17.0.1. It is not your machine's LAN address, and neither are veth pairs or virbr0 from libvirt. Ignore virtual interfaces when looking for your real IP.
How do I find my IPv6 address on Linux?
Run ip -6 addr and look for inet6 lines with scope global; fe80:: addresses with scope link only work on the local network. For the public IPv6 that websites see, run curl -6 icanhazip.com.