Several ways to query the extranet IP under Linux (GO)

Source: Internet
Author: User
Tags bash script example curl

Curl Plain Text Format output:
Curl Icanhazip.comcurl ifconfig.mecurl curlmyip.comcurl ip.appspot.comcurl ipinfo.io/ipcurl ipecho.net /Plaincurl www.trackip.net/I
Curl JSON format output:
Curl ipinfo.io/jsoncurl ifconfig.me/all.jsoncurl www.trackip.net/ip?json (a bit ugly)
Curl XML Format output:
Curl Ifconfig.me/all.xml
Curl gets all IP details (excavator)
Curl Ifconfig.me/all
Use Dydns (useful when you use the Dydns service)
' http://checkip.dyndns.org ' ' s/.*current IP Address: \ ([0-9\.] *\). */\1/g'-S http://checkip.dyndns.org/| grep-o "[[:d Igit:]. \+"
Use Wget instead of Curl
wget http://ipecho.net/plain-o-Q; Echowget http://observebox.com/ip-o-Q; ech o
Use the host and Dig commands (if available, you can also use the host and Dig commands directly.) )
' S/.*has address// '  + short myip.opendns.com @resolver1. opendns.com
Bash Script Example:
#!/bin/bashpublic_ip= ' wget http://ipecho.net/plain-o-Q; Echo 'echo $PUBLIC _ip

Transferred from: https://my.oschina.net/epstar/blog/513186

Several ways to query the extranet IP under Linux (GO)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.