Curl 纯文本格式输出:

curl icanhazip.com
curl ifconfig.me
curl curlmyip.com
curl ip.appspot.com
curl ipinfo.io/ip
curl ipecho.net/plain
curl www.trackip.net/i

curl JSON格式输出:

curl ipinfo.io/json
curl ifconfig.me/all.json
curl www.trackip.net/ip?json (有点丑陋)

curl XML格式输出:

curl ifconfig.me/all.xml

curl 得到所有IP细节 (挖掘机)

curl ifconfig.me/all

使用 DYDNS (当你使用 DYDNS 服务时有用)

curl -s 'http://checkip.dyndns.org' | sed 's/.*Current IP Address: \([0-9\.]*\).*/\1/g'
curl -s http://checkip.dyndns.org/ | grep -o "[[:digit:].]\+"

使用 Wget 代替 Curl

wget http://ipecho.net/plain -O - -q ; echo
wget http://observebox.com/ip -O - -q ; echo

使用 host 和 dig 命令(如果有的话,你也可以直接使用 host 和 dig 命令。)

host -t a dartsclink.com | sed 's/.*has address //'
dig +short myip.opendns.com @resolver1.opendns.com

bash 脚本示例:

#!/bin/bash
PUBLIC_IP=`wget http://ipecho.net/plain -O - -q ; echo`
echo $PUBLIC_IP

转自:https://my.oschina.net/epstar/blog/513186

几种在Linux下查询外网IP的办法(转)的更多相关文章

  1. 几种在Linux下查询外网IP的办法。

    几种在Linux下查询外网IP的办法.   Curl 纯文本格式输出: curl icanhazip.com curl ifconfig.me curl curlmyip.com curl ip.ap ...

  2. 几种在Linux下查询外网IP的办法

    原文地址:http://my.oschina.net/epstar/blog/513186 Curl 纯文本格式输出: curl icanhazip.com curl ifconfig.me curl ...

  3. Linux下查询外网IP的办法。

    Curl 纯文本格式输出:curl icanhazip.comcurl ifconfig.mecurl curlmyip.comcurl ip.appspot.comcurl ipinfo.io/ip ...

  4. linux下获取外网IP

    使用阿里云或者有多个网卡IP的机器需要取外网IP时,可以用下面这种 wget -qO - ifconfig.co 更多方法参考:https://yq.aliyun.com/ziliao/105999

  5. linux 下查看外网ip

    1. curl ipinfo.io ~/codes/qt_codes/qt-5.4.1-build$ curl ipinfo.io{  "ip": "114.241.21 ...

  6. linux下的外网木马前期要的工具

    这周看了demon哥的博客弄msf外网马,自己试了一下 首先去ngrok官网下载对应的系统版本,如果对应下载那个标签是绿色的(这里不支持windows) 下载好后在linux提取出来 让我们来看看他的 ...

  7. linux下查询域名或IP注册信息的操作记录(whois)

    在运维工作中,有时需要查询某些域名的注册信息(域名的NS,注册用户,注册邮箱等),可以使用whois这个命令.whois命令令用来查找并显示指定帐号(或域名)的用户相关信息,因为它是到Network ...

  8. Linux服务器查看外网IP地址的命令

    可以直接输入如下几个命令:1.curl ifconfig.me2.curl cip.cc3.curl icanhazip.com4.curl ident.me5.curl ipecho.net/pla ...

  9. 查看Linux机器的外网IP

    curl icanhazip.comcurl ifconfig.mecurl curlmyip.comcurl ip.appspot.comcurl ipinfo.io/ipcurl ipecho.n ...

随机推荐

  1. Java集合之LinkedList源码解析

    LinkedList简介 LinkedList基于双向链表,即FIFO(先进先出)和FILO(先进后出)都是支持的,这样它可以作为堆栈,队列使用 继承AbstractSequentialList,该类 ...

  2. MongoDB的php可视化管理工具

    使用MongoDB命令查看很不方便 于是想把爬来的数据导出来,看爬来的数据是否正确 打开cmd,执行 mongoexport -d test -c blogs --csv -f title,link, ...

  3. Array常用函数收藏

    1.isArray 语法:Array.isArray(obj) 说明:判断一个对象是否是数组. 例如: Array.isArray([]); Array.isArray([1]); Array.isA ...

  4. QT编译错误:member access into incomplete type 'QMouseEvent'

    想在QT程序中使用鼠标事件,添加重载的响应函数,并实现后,一直提示 member access into incomplete type 'QMouseEvent' 既然使用了QMouseEvent类 ...

  5. 安装程序配置服务器失败。参考服务器错误日志和C:\windows\sqlstp.log 了解更多信息

    重装sql经常遇到2个问题 1,以前的某个程序安装已在安装计算机上创建挂起的文件操作.运行安装程序之前必须重新启动计算机. 删除C:\Program Files\Microsoft SQL Serve ...

  6. NPOI把Excel导入到数据库

    二,把Excel中的数据导入到数据库的具体步骤: protected void Button1_Click(object sender, EventArgs e)        {           ...

  7. MyBatis 支持的扩展点(version:3.2.7)

    从 [MyBatis 原码解析(version:3.2.7)] 中,我们得知,MyBatis去执行SQL都是通过 DefaultSqlSession 中的工具方法去执行的. 那么问题来了,MyBati ...

  8. 【Cesium】坐标理解(转)

    https://blog.csdn.net/qq_34149805/article/details/78393540 1. 经纬度转换为世界坐标 第一种方式:直接转换: Cesium.Cartesia ...

  9. 【代码审计】UKCMS_v1.1.0 文件上传漏洞分析

      0x00 环境准备 ukcms官网:https://www.ukcms.com/ 程序源码下载:http://down.ukcms.com/down.php?v=1.1.0 测试网站首页: 0x0 ...

  10. Installing Python Modules

    Email: distutils-sig@python.org As a popular open source development project, Python has an active s ...