原文地址: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

最新文章

  1. Lesson 21 Mad or not?
  2. UVALive 4428 Solar Eclipse --计算几何,圆相交
  3. PAT 1036. 跟奥巴马一起编程(15)
  4. HTML案例—很讨巧的一种js+css制作hover模式展示二级菜单方法
  5. xcode配置绝对路径与相对路径
  6. 随机生成验证码import random
  7. Android数据共享
  8. iOS开发-关于网络状态的判断
  9. Workspace in use or cannot be created, choose a different one.--错误解决办法
  10. PHPFarm - How to run multiple versions of PHP on the same computer
  11. Selenium1 Selenium2 WebDriver
  12. eclipse 项目引入第三方jar包 3种方法
  13. 【Android测试工具】Android抓包解析全过程
  14. [python3.5][PyUserInput]模拟鼠标和键盘模拟
  15. logback配置信息
  16. cacti报警邮件的设置
  17. Jan.07
  18. 三、fgetc与fputc
  19. jquery-easyui:格式化列
  20. php的session获取不到问题之ie浏览器(yaf框架)

热门文章

  1. fckeditor使用(转)
  2. PHP将XML转成数组
  3. C语言实现冒泡排序-整数排序
  4. django with mysql (part-4)
  5. Django模板系统
  6. Libjingle库简介
  7. 关于《精通移动App测试实战:技术、工具和案例》图书勘误信息
  8. SCN试验之二 checkpoin scn 与数据库scn的关系
  9. DataGridView很详细的用法(转载)
  10. COM是一个更好的C++