查看外网IP

参考资料:

cURL 查询公网出口 IP

https://www.jianshu.com/p/09363560a833

1. curl ifconfig.me
2. curl cip.cc
3. curl icanhazip.com
4. curl ident.me
5. curl ipecho.net/plain
6. curl whatismyip.akamai.com
7. curl tnx.nl/ip
8. curl myip.dnsomatic.com
9. curl ip.appspot.com
10. curl -s checkip.dyndns.org | sed 's/.*IP Address: \([0-9\.]*\).*/\1/g'
ip-api.com(推荐,速度快)

ipecho.net(推荐)

ip.cn(不支持 curl)

ipinfo.io

cip.cc

ifconfig.me

myip.ipip.net

ip-api.com 接口:

curl 'http://ip-api.com/json/?lang=zh-CN'
{
  "status": "success",
  "country": "德国",
  "countryCode": "DE",
  "region": "HE",
  "regionName": "Hesse",
  "city": "法兰克福",
  "zip": "60313",
  "lat": 50.1188,
  "lon": 8.6843,
  "timezone": "Europe/Berlin",
  "isp": "Linode, LLC",
  "org": "Linode, LLC",
  "as": "AS63949 Linode, LLC",
  "query": "192.46.239.172"
}

ipecho.net 接口:

curl ipecho.net/plain
111.22.222.33

cip.cc: 

curl cip.cc
IP: 111.22.222.11
地址: 阿根廷  阿根廷
数据二: 新加坡 | XX云
数据三: 阿根廷
URL: http://www.cip.cc/111.22.222.11

 

 
 
posted @ 2023-11-30 15:00  fieldtianye  阅读(63)  评论(0编辑  收藏  举报