The easiest way to find your public IP address is to search “What Is My IP?

in any search engine.

But how do you know what they are?

The Linux terminal open on the MALIBAL Aon S1.JPG

Hannah Stryker / How-To Geek

Here are a few ways to find each on Linux.

What is an IP Address?

your machine can have multiple different IPs that allow it to be identified on different networks.

Your IPv4 and IPv6 IP addresses displayed.

Most of them involve using the Terminal.

you’ve got the option to typically use either.

Related:What Is IPv6, and Why Does It Matter?

Your IPv4 and IPv6 settings on Linux Mint.

Here is how you do it on a few popular versions of Linux.

Lots ofLinux distributions, including Ubuntu and Fedora, use theGNOMEdesktop environment.

As a result, they tend to be extremely similar.

Your IPv4 and IPv6 addresses displayed on Fedora.

There might be minor differences from customizations made for that specific distro.

hit the gear icon next to your web connection.

In this case, it is a wired web link.

The output of the ip addr command.

If you’re connecting wirelessly, you will see something indicating that instead.

The connection prefs page displays both your local IPv4 and IPv6 address.

Click it, then select “online grid parameters” from the listed options.

The output of the ifconfig command.

tap the online grid icon in the upper right corner of the screen, then tap the gear icon.

confirm that the “data pipe” tab is selected, then choose the new gear icon.

Your IPv4 and IPv6 addresses will be listed right in the middle of the screen.

The output of the hostname -I command.

Now, prior to beginning, there are a few important things to keep in mind.

This article used virtual machines, so our adapters are not named ETH0 or WLAN0.

You’re looking for two entries, one named inet and the other named inet6.

An IP address after searching "What is my ip?" on Google.

The first is your IPv4 address, and the second one is your IPv6 address.

Find your Local IP with ifconfig

Ifconfig is a part of the net-tools package.

It doesn’t ship with Ubuntu by default and may not come with your distro either.

The result of using the OpenDNS website with the host command to recover your public IP.

Here is what we got, with the desired results highlighted.

Once again, inet is your IPv4 address, and inet6 is the IPv6 address.

Open up the Terminal, then enter:

It is essential that the “i” is capitalized.

The results of the dig command, again using OpenDNS website, to find your public IP.

You’ll be given a single line with your IP address displayed.

That only works if you’re running a Linux distro with a user interface, though.

Find Public IP Address with host

The host command is typically used for simple DNS lookups.

However, it can also be used to reveal your own external IP address with the right arguments.

Enter:

The first few lines tell you about the OpenDNS site itself.

The last line is the one we really care about.

It shows your IP address.

We’ve obfuscated our IP with a green block, but it did return the correct address.

We’re once again leaning onOpenDNSto provide our external IP address.

The dig command will probably be installed by default.

If it isn’t, roll out the “bind-tools” package to get it.