Skip to content

Instantly share code, notes, and snippets.

@leafsummer
Created June 18, 2016 12:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save leafsummer/3891afc4c9f8e49bc9cbd6b590aee9dd to your computer and use it in GitHub Desktop.
Save leafsummer/3891afc4c9f8e49bc9cbd6b590aee9dd to your computer and use it in GitHub Desktop.
curl my ip
#满足了一下自己的搜集癖,搜集了不少可以用来查询外网IP的网址和方法。
#国内某网站的接口,只返回IP
curl ip.6655.com/ip.aspx
curl whatismyip.akamai.com
curl ipip.net
#更多用法访问ifconfig.co
wget -qO - ifconfig.co
curl icanhazip.com
dig +short myip.opendns.com @resolver1.opendns.com
curl ident.me
curl v4.ident.me
curl v6.ident.me
#
curl curlmyip.com
curl ifconfig.me
curl inet-ip.info
#返回IP和地区
curl ip.6655.com/ip.aspx?area=1
curl ip.cn
curl cip.cc
#需要翻x墙,只返回IP
curl ip.appspot.com
#参考 http://unix.stackexchange.com/questions/22615/how-can-i-get-my-external-ip-address-in-bash
#有人给了以下测试方法
wget https://raw.githubusercontent.com/rsp/scripts/master/externalip-benchmark
chmod a+x externalip-benchmark
./externalip-benchmark
#返回JSON格式的数据
C:\>curl httpbin.org/get
{
"args": {},
"headers": {
"Accept": "*/*",
"Host": "httpbin.org",
"User-Agent": "curl/7.28.1"
},
"origin": "222.216.164.78",
"url": "http://httpbin.org/get"
}
C:\>curl httpbin.org/ip
{
"origin": "116.11.199.77"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment