原文地址:http://my.oschina.net/epstar/blog/513186

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

nmap

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

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

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

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

    Curl 纯文本格式输出: curl icanhazip.com curl ifconfig.me curl curlmyip.com curl ip.appspot.com curl ipinfo. ...

  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. APP API如何维护多个版本的一些想法?

    1.第一种形式:api版本号放在url路径中 https://api.example.com/v1/user/ID https://api.example.com/v2/user/ID https:/ ...

  2. iOS UITableView中点击状态栏无法回滚到顶部

    // When the user taps the status bar, the scroll view beneath the touch which is closest to the stat ...

  3. Redis教程(七):Key操作命令详解

    转载于:http://www.itxuexiwang.com/a/shujukujishu/redis/2016/0216/134.html?1455807040 一.概述: 在该系列的前几篇博客中, ...

  4. javascript设计模式与开发实践阅读笔记(7)——迭代器模式

    迭代器模式:指提供一种方法顺序访问一个聚合对象中的各个元素,而又不需要暴露该对象的内部表示. 迭代器模式可以把迭代的过程从业务逻辑中分离出来,在使用迭代器模式之后,即使不关心对象的内部构造,也可以按顺 ...

  5. Goodchild教授关于GIS的四大预测的不同看法

    Goodchild教授的关于GIS的4个未来发展的预测不断有人在微信朋友圈里转发,虽然现在做的工作GIS只是一个基本的工具之一了,但对这4个预测还是有不少不同看法和一点自己的意见. Goodchild ...

  6. ASP.NET Web API中的参数绑定总结

    ASP.NET Web API中的action参数类型可以分为简单类型和复杂类型. HttpResponseMessage Put(int id, Product item) id是int类型,是简单 ...

  7. Autosizer应用程序窗口控制工具

    Autosizer是一个系统辅助软件,窗口控制工具,它能指定程序窗口的大小位置置顶等,可以将窗口最大化,最小化,比如在需要截图的时候可以讲窗口设定大小640*480,然后用FSCapture捕捉活动窗 ...

  8. 江豚科技|专业移动APP开发与移动互联网解决方案

    北京江豚科技(www.eoiiioe.com)是国内领先的移动APP开发解决方案服务商,总部在中国的硅谷--中关村,分别在郑州.深圳设有服务机构. 江豚科技承接各类移动app开发外包和软件定制开发,我 ...

  9. SSD性能对比

    SSD性能测试顺序写 16k iops 85061.08顺序写 8k iops 146250.93顺序写 4k iops 239816.69顺序写 2k iops 294540.87顺序写 1k io ...

  10. 可扩展验证框架 - A2DFramework验证框架使用介绍

    SUMMARY 用途 DEMO演示 NuGet相关的资料 VS工具端的设置 用途 数据验证的作用很重要,目前.NET提供的内建验证机制是采用DataAnnotation方式来实现属性的验证,并且也提供 ...