命令行查看公网IP地理位置 使用curl

1,使用curl命令 查看本机公网IP地理位置

curl cip.cc
  • curl ipinfo.io
$ curl ipinfo.io
{
  "ip": "34.80.248.126",
  "hostname": "126.248.80.34.bc.googleusercontent.com",
  "city": "New York City",
  "region": "New York",
  "country": "US",
  "loc": "40.7143,-74.0060",
  "org": "AS15169 Google LLC",
  "postal": "10004",
  "timezone": "America/New_York",
  "readme": "https://ipinfo.io/missingauth"
  • curl cip.cc
$ curl cip.cc
IP	: 34.80.248.126
地址	: 美国  美国

数据二	: 台湾省 | 彰化县Google云计算数据中心

数据三	: 美国德克萨斯休斯顿

URL	: http://www.cip.cc/34.80.248.126
  • curl ip.gs
$ curl ip.gs
Current IP / 当前 IP: 34.80.248.126
ISP / 运营商:  cloud.google.com
City / 城市: Changhua County Taiwan
Country / 国家: China

2,查询指定公网IP地理位置信息

curl cip.cc/ip

─➤  curl cip.cc/8.8.8.8
IP      : 8.8.8.8
地址    : GOOGLE.COM  GOOGLE.COM
运营商  : level3.com

数据二  : 美国 | 加利福尼亚州圣克拉拉县山景市谷歌公司DNS服务器

数据三  : 美国 | Level3

URL     : http://www.cip.cc/8.8.8.8

curl freeapi.ipip.net/ip

╰─➤  curl freeapi.ipip.net/35.194.24.24
["美国","爱荷华州","康瑟尔布拉夫斯","","cloud.google.com"]

3,返回公网IP

curl ip.gs
curl ip.sb
curl whatismyip.akamai.com
curl icanhazip.com
curl ifconfig.cat

4,ipinfo.io

curl ipinfo.io/<IP>

5,ip.tool.lu

curl -L ip.tool.lu

参考:

  1. [命令行] curl查询公网出口IP
  2. 本地公网IP
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值