Ubuntu Linux: Determine Your IP Address

by on January 17, 2003 · 0 comments· LAST UPDATED January 17, 2014

in , ,

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
DifficultyEasy (rss)
Root privilegesNo
RequirementsNone
Estimated completion time2m
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

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

Finding gateway address in Ubuntu

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

default via 192.168.1.254 dev eth1  proto static 
169.254.0.0/16 dev eth1  scope link  metric 1000
172.16.33.0/24 dev vmnet8  proto kernel  scope link  src 172.16.33.1
192.168.1.0/24 dev eth1  proto kernel  scope link  src 192.168.1.5  metric 1
192.168.136.0/24 dev vmnet1  proto kernel  scope link  src 192.168.136.1

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

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
ifconfig eth0
ifconfig eth1

Sample outputs:

Fig. 03: ifconfig command in action

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

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

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

See also
TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 0 comments… add one now }

Leave a Comment

Tagged as: , , ,

Previous Faq:

Next Faq: