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:
Tutorial details
Difficulty level Easy
Root privileges No
Requirements None
Est. reading time 2m
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)

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 0 comments... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf duf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Modern utilitiesbat exa
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg glances gtop jobs killall kill pidof pstree pwdx time vtop
Searchingag grep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
0 comments… add one

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum