In this tutorial, we will show how to use the Ubuntu ip command to see information about the local IP address, default gateway, and DNS servers on Ubuntu 20.04 Focal Fossa Linux. The IP address is used by your Ubuntu machine to talk to other devices on the network, like a router or other PCs. Keep in mind that your internal IP address is different from your system’s external IP.
It’s possible on Ubuntu to get IP address from command line or from GUI. This makes the task easy to do both on Ubuntu Server and Ubuntu Desktop. We will cover the step by step instructions for both methods below.
In this tutorial you will learn:
- How to find local IP address with Ubuntu ip command
- How to check for default gateway
- How to display DNS server IP address
- How to display MAC address
Software Requirements and Conventions Used
|Requirements, Conventions or Software Version Used
|Installed Ubuntu 20.04 or upgraded Ubuntu 20.04 Focal Fossa
|Privileged access to your Linux system as root or via the
|# – requires given linux commands to be executed with root privileges either directly as a root user or by use of
$ – requires given linux commands to be executed as a regular non-privileged user
How to find my IP address on Ubuntu 20.04 step by step instructions
Ubuntu get ip address command line
Your system’s internal (private) IP address is different from the external (public) IP address. The private IP address (which we will be finding below) remains hidden from all devices outside of your network. It is the IP address that your computer uses to communicate with devices on the LAN (Local Area Network).
- To check for your internal IP address execute the following command:
$ ip a
Locate the requested network interface and check for assigned IP address. Additionally, the above command also reveals the network interface hardware address (also called MAC address).
- To check for currently used DNS server IP address execute:
$ systemd-resolve --status | grep Current
- To display default gateway IP address run:
$ ip r
Check for internal network configuration from GUI
To check for the internal IP address, default gateway, MAC address and DNS server settings on Ubuntu 20.04 Focal Fossa desktop first open
Settings and click on
Network menu and hit the gear wheel of the desired network interface.
Do you want to change your Ubuntu system’s IP address? Check out our other tutorial on How to configure static IP address on Ubuntu 20.04 Focal Fossa Desktop/Server
In this tutorial, we saw how to get network information from command line and GUI on Ubuntu 20.04 Focal Fossa Linux. These settings are essential to enable networking functionality on your system, and can be shared out to neighboring equipment to make connections. Such information includes the IP address, MAC address, default gateway, and DNS server IP addresses that are configured for the system.