How to find my IP address on Ubuntu 20.04 Focal Fossa Linux

The purpose of this tutorial is to show 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.

It’s possible on Ubuntu to get IP address from command line or from GUI. 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

How to find my IP address, default gateway and DNS server on Ubuntu 20.04 Focal Fossa Linux from command line

How to find my IP address, default gateway, MAC address and DNS server on Ubuntu 20.04 Focal Fossa Linux from command line

Software Requirements and Conventions Used

Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System Installed Ubuntu 20.04 or upgraded Ubuntu 20.04 Focal Fossa
Software N/A
Other Privileged access to your Linux system as root or via the sudo command.
Conventions # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ – 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



  1. 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 a.k.a MAC address.

  2. To check for currently used DNS server IP address execute:
    $ systemd-resolve --status | grep Current
    
  3. 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.

How to find my IP address, default gateway and DNS server on Ubuntu 20.04 Focal Fossa desktop
How to find my IP address, default gateway and DNS server on Ubuntu 20.04 Focal Fossa desktop

Closing Thoughts

In this tutorial, we saw how to get network information from command line and GUI on Ubuntu 20.04 Focal Fossa Linux. Such information includes the IP address, MAC address, default gateway, and DNS server IP addresses that are configured for the system.