加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

查看当前外网IP

发布时间:2020-12-15 07:10:54 所属栏目:安全 来源:网络整理
导读:今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #满足了一下自己的搜集癖,搜集了不少可以用来查询外网IP的网址和方法。#国内某网站的接口,只返回IPcurl ip.6655.com/ip.aspxcurl whatismyip.akamai

以下代码由PHP站长网 52php.cn收集自互联网

现在PHP站长网小编把它分享给大家,仅供参考

#满足了一下自己的搜集癖,搜集了不少可以用来查询外网IP的网址和方法。


#国内某网站的接口,只返回IP
curl ip.6655.com/ip.aspx
curl whatismyip.akamai.com
#更多用法访问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"
}


以上内容由PHP站长网【52php.cn】收集整理供大家参考研究

如果以上内容对您有帮助,欢迎收藏、点赞、推荐、分享。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读