Ubuntu Linux: Determine Your IP Address

I am a new Ubuntu Linux user. How do I find out my IP address in Ubuntu Linux? How to find my own IP address in Ubuntu Linux using command line?

You can use GUI tool or command line options to find out IP address, subnet and other information in Ubuntu Linux. You can use the following command:

a) ifconfig command – Display or configure networking.

b) ip command – Display or configure networking including routing.

c) Network Manger – Gui tool to configure or display network information.

HowTo Find your IP address in Ubuntu Linux

Let us see how to use command line tools to find out IP address either using ip or ifconfig command.

Find Your IP in Ubuntu using ip command

Open the Terminal and type the following ip command:
ip a list
ip a list eth0
ip a list eth1

Sample outputs:

Fig. 01: Display an IP address using ip command on Ubuntu server

Finding gateway address in Ubuntu

My ip address is To see default routing (gateway) IP address in Ubuntu Linux, enter:
ip r
Sample outputs:

default via dev eth1  proto static dev eth1  scope link  metric 1000 dev vmnet8  proto kernel  scope link  src dev eth1  proto kernel  scope link  src  metric 1 dev vmnet1  proto kernel  scope link  src 

Finding DNS server IP address in Ubuntu

Use the following cat command to display your DNS server in Ubuntu Linux:
cat /etc/resolv.conf
Sample outputs:

Fig.02 Displaying DNS server IP address in Ubuntu

Find Your IP in Ubuntu using ifcofig command

You can also use the following ifconfig command to find out the IP address on Ubuntu server/desktop or laptop:
ifconfig eth0
ifconfig eth1

Sample outputs:

Fig. 03: ifconfig command in action

GUI tools to find out IP address and DNS on Ubuntu

Just click on the network icon (top right side) in the notification area > Select “Connection information” menu:

Fig. 04: Network Connection info option

You will see the following window with your IP address including DNS server IP address:

Fig.05: Displaying IP and DNS server address on Ubuntu

See also
  • Man pages: resolv.conf(5)

Posted by: SXI ADMIN

The author is the creator of SXI LLC and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post

How to Make Website WCAG Compliant?

Next Post

Link download Kali Linux 2020.1 (ISO + Torrent)

Related Posts