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)