{"id":2368,"date":"2020-12-07T11:26:39","date_gmt":"2020-12-07T11:26:39","guid":{"rendered":"https:\/\/linuxways.net\/?p=2368"},"modified":"2020-12-07T11:28:02","modified_gmt":"2020-12-07T11:28:02","slug":"how-to-find-your-public-ip-address-in-ubuntu-20-04-lts","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/ubuntu\/how-to-find-your-public-ip-address-in-ubuntu-20-04-lts\/","title":{"rendered":"How to Find Your Public IP address in Ubuntu 20.04 LTS"},"content":{"rendered":"<p><a href=\"https:\/\/linuxways.net\/de\/ubuntu\/how-to-find-your-ip-address-in-ubuntu-20-04-lts\/\">In one of my earlier posts, I have shown you the methods of finding your private IP address in Ubuntu 20.04.<\/a> This post is dedicated to all the methods of finding your public IP address.<\/p>\n<p>We have used Ubuntu 20.04. However, some of the below methods may also be used in other Linux distributions.  Here we go.<\/p>\n<h2>Finding Public IP Address in Ubuntu 20.04<\/h2>\n<h3>Method 1: Using Google<\/h3>\n<p>Open your Google Chrome browser and search with the keyword \u201cwhat is my ip\u2019. Google will show your public IP.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"928\" height=\"309\" class=\"wp-image-2369\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-75.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-75.png 928w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-75-300x100.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-75-768x256.png 768w\" sizes=\"auto, (max-width: 928px) 100vw, 928px\" \/><\/p>\n<h3>Method 2: Querying the DNS providers<\/h3>\n<p>Many DNS providers will let you access your public IP address information.<\/p>\n<h4>Method 1: Using dig command<\/h4>\n<p>You can access your public IP address information from your DNS provider by using any of the following dig commands.<\/p>\n<pre>dig +short myip.opendns.com @resolver1.opendns.com<\/pre>\n<pre>dig ANY +short @ns1-1.akamaitech.net ANY whoami.akamai.net<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"735\" height=\"112\" class=\"wp-image-2370\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-76.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-76.png 735w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-76-300x46.png 300w\" sizes=\"auto, (max-width: 735px) 100vw, 735px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"736\" height=\"128\" class=\"wp-image-2371\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-77.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-77.png 736w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-77-300x52.png 300w\" sizes=\"auto, (max-width: 736px) 100vw, 736px\" \/><\/p>\n<h4>Method 2: Using host command<\/h4>\n<p>You can also query your public IP address information from your DNS provider by using the following host command.<\/p>\n<pre>host myip.opendns.com resolver1.opendns.com<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"734\" height=\"186\" class=\"wp-image-2372\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-78.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-78.png 734w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-78-300x76.png 300w\" sizes=\"auto, (max-width: 734px) 100vw, 734px\" \/><\/p>\n<p>Or You can further narrow the answer by using grep and awk in your command.<\/p>\n<pre>host myip.opendns.com resolver1.opendns.com | grep \"myip.opendns.com has\" | awk '{print $4}'<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"738\" height=\"153\" class=\"wp-image-2373\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-79.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-79.png 738w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-79-300x62.png 300w\" sizes=\"auto, (max-width: 738px) 100vw, 738px\" \/><\/p>\n<h3>Method 3: Using Online Services<\/h3>\n<p>Several online services provide your public IP address information. For example, you can access this information by downloading files from these service providers.<\/p>\n<ol>\n<li>IP Echo Service: ipecho.net<\/li>\n<li>icanhazip.com<\/li>\n<li>ifconfig.co<\/li>\n<li>Ifconfig.me<\/li>\n<li>ipinfo.io<\/li>\n<\/ol>\n<h4>Method 1: Using wget command<\/h4>\n<p>First, install wget using the following command and enter your password if prompted.<\/p>\n<pre>sudo apt update &amp;&amp; sudo apt install wget -y<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"739\" height=\"155\" class=\"wp-image-2374\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-80.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-80.png 739w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-80-300x63.png 300w\" sizes=\"auto, (max-width: 739px) 100vw, 739px\" \/><\/p>\n<p>Then, you can use any following wget command to find your public IP from the mentioned service providers.<\/p>\n<pre>wget -qO- http:\/\/ipecho.net\/plain | xargs echo<br \/><br \/>wget -qO- ifconfig.co<br \/><br \/>wget -qO- ifconfig.me | xargs echo<br \/><br \/>wget -qO- https:\/\/ipinfo.io\/ip<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"736\" height=\"127\" class=\"wp-image-2375\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-81.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-81.png 736w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-81-300x52.png 300w\" sizes=\"auto, (max-width: 736px) 100vw, 736px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"733\" height=\"93\" class=\"wp-image-2376\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-82.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-82.png 733w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-82-300x38.png 300w\" sizes=\"auto, (max-width: 733px) 100vw, 733px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"734\" height=\"111\" class=\"wp-image-2377\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-83.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-83.png 734w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-83-300x45.png 300w\" sizes=\"auto, (max-width: 734px) 100vw, 734px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"738\" height=\"100\" class=\"wp-image-2378\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-84.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-84.png 738w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-84-300x41.png 300w\" sizes=\"auto, (max-width: 738px) 100vw, 738px\" \/><\/p>\n<h4>Method 2: Using CURL command<\/h4>\n<p>First, install cURL using the following command and enter your password if prompted.<\/p>\n<pre>sudo apt update &amp;&amp; sudo apt install curl -y<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"739\" height=\"192\" class=\"wp-image-2379\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-85.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-85.png 739w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-85-300x78.png 300w\" sizes=\"auto, (max-width: 739px) 100vw, 739px\" \/><\/p>\n<p>You can then use these CURL commands to find your public IP from service providers.<\/p>\n<pre>curl ifconfig.co<br \/><br \/>curl ifconfig.me &amp;&amp; echo<br \/><br \/>curl icanhazip.com &amp;&amp; echo<br \/><br \/>curl https:\/\/ipinfo.io\/ip<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"734\" height=\"112\" class=\"wp-image-2380\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-86.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-86.png 734w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-86-300x46.png 300w\" sizes=\"auto, (max-width: 734px) 100vw, 734px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"738\" height=\"106\" class=\"wp-image-2381\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-87.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-87.png 738w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-87-300x43.png 300w\" sizes=\"auto, (max-width: 738px) 100vw, 738px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"740\" height=\"135\" class=\"wp-image-2382\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-88.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-88.png 740w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-88-300x55.png 300w\" sizes=\"auto, (max-width: 740px) 100vw, 740px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"735\" height=\"104\" class=\"wp-image-2383\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-89.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-89.png 735w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-89-300x42.png 300w\" sizes=\"auto, (max-width: 735px) 100vw, 735px\" \/><\/p>\n<p>I hope you have learned from this article. Comment below for any problem or suggestion, thank you and have a good day.<\/p>\n\n\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>In one of my earlier posts, I have shown you the methods of finding your private IP address in Ubuntu 20.04. This post is dedicated to all the&hellip;<\/p>","protected":false},"author":7,"featured_media":2386,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[99,100],"class_list":["post-2368","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ubuntu","tag-public-ip-address","tag-ubuntu-20-04"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/2368","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=2368"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/2368\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/2386"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=2368"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=2368"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=2368"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}