Search Authority

How to Find IP Address in Ubuntu: Simple Command Line Tips

Finding the IP address in Ubuntu is essential for troubleshooting network issues, setting up services, or securing your system. This guide walks you through several reliable met...

Mara Ellison Jul 24, 2026
How to Find IP Address in Ubuntu: Simple Command Line Tips

Finding the IP address in Ubuntu is essential for troubleshooting network issues, setting up services, or securing your system. This guide walks you through several reliable methods using the terminal and graphical tools.

Whether you need the local address for file sharing or the public address for remote access, Ubuntu provides multiple ways to retrieve this information quickly.

Method Command or Tool Use Case Output Example
Terminal - ip command ip addr Quick local IP lookup for all interfaces inet 192.168.1.10/24
Terminal - hostname hostname -I Print all active IP addresses in one line 192.168.1.10
Graphical - Settings Settings > Wi-Fi or Ethernet GUI method for desktop users who prefer point-and-click 192.168.1.10
Terminal - ifconfig ifconfig Classic interface details, requires net-tools inet addr:192.168.1.10
NetworkManager CLI nmcli device show Inspect detailed connection and IP properties IP4.ADDRESS[1]: 192.168.1.10/24

Using the ip Command in Terminal

The ip command is the modern replacement for ifconfig and is available by default on most Ubuntu installations. It provides clear and precise information about network interfaces and their addresses.

To see all interfaces and their configurations, open the terminal and run ip addr. Look for the inet field under your active interface, such as enp0s3 or eth0, to locate your local IP address.

This method works both on physical machines and virtual environments, making it a dependable choice for server and desktop users who need accurate network details without installing extra packages.

Using hostname -I for a Quick Output

If you only need the primary IP address without interface details, the hostname -I command prints all assigned IP addresses on active interfaces in a single line.

This is especially useful in scripts or when you want a fast, human-readable result. It excludes loopback and interface metadata, showing only the addresses you can use for network communication.

Run it by typing hostname -I in the terminal and pressing Enter to instantly retrieve your local IP address in Ubuntu.

Finding IP Through Graphical Settings

Desktop users who prefer a visual interface can find the IP address in Ubuntu through the Settings application without opening the terminal.

Navigate to Settings, then select Wi-Fi or Ethernet depending on your connection. Click on the active connection to view detailed information, including the assigned IP address, gateway, and DNS settings.

Using ifconfig and Installing Legacy Tools

Although ifconfig is not installed by default on newer Ubuntu systems, it can be added for compatibility with older workflows and specific administrative tasks.

Install the net-tools package with sudo apt install net-tools, then run ifconfig to see interface details. The inet field shows the local IP for each available network interface.

Use this method only if you rely on ifconfig output format or need to support documentation that references legacy command patterns.

Using nmcli for Advanced Inspection

NetworkManager Command Line Interface, or nmcli, provides detailed information about devices, connections, and IP configurations in Ubuntu.

Execute nmcli device show to list properties for every device. Locate lines starting with IP4.ADDRESS to find the assigned IP along with the subnet mask and scope.

This approach is ideal for users who manage multiple connections, require scripting-friendly output, or want to verify configuration correctness from the command line.

Key Takeaways for Finding IP Address in Ubuntu

  • Use ip addr for detailed interface information and multiple addresses
  • Use hostname -I for a compact list of active IPs
  • Check graphical Settings for a no-terminal, point-and-click approach
  • Install net-tools only if you need ifconfig compatibility
  • Use nmcli for scripting and in-depth NetworkManager inspection
  • Remember that local commands do not show your public IP on the internet

FAQ

Reader questions

Why does my hostname -I not show all IPs like ip addr does?

hostname -I only prints the primary non-loopback IP addresses on active interfaces, while ip addr displays every interface, including loopback and down interfaces with full configuration details.

Can I find the public IP address using these commands in Ubuntu?

No, the commands covered here show only local or private IPs assigned by your router. To find your public IP, use a web service or tool like curl ifconfig.me or dig +short myip.opendns.com @resolver1.opendns.com.

How do I know which interface name to look for, such as enp0s3 or eth0?

Run ip link or ip addr without filters to list all interfaces. The interface currently handling network traffic with an inet address is the one you need for your local IP.

Is it safe to share the IP address shown in nmcli device show?

Sharing the local IP address is generally safe, but avoid exposing sensitive network details in untrusted environments. Use these commands on systems you control and restrict access to trusted users.

Related Reading

More pages in this topic cluster.

How to Tell the Difference Between Silver and Aluminum (Silver vs Aluminum)

Spotting the difference between silver and aluminum helps you verify purchases, appraise items, and avoid overpaying for misidentified metals. While they look similar at first g...

Read next
Excel Keyboard Shortcut for Strikethrough: Easy Step-by-Step Guide

Mastering the Excel keyboard shortcut for strikethrough helps you track completed tasks, revisions, and action items without leaving the keyboard. This small efficiency habit sp...

Read next
Durham NC News Today: Latest Headlines & Updates

Durham NC news keeps the Research Triangle region informed about breakthrough healthcare, education, and downtown development. Local reporting connects residents and visitors to...

Read next