几种在Linux下查询外网IP的办法。
几种在Linux下查询外网IP的办法。
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
几种在Linux下查询外网IP的办法。的更多相关文章
- 几种在Linux下查询外网IP的办法
原文地址:http://my.oschina.net/epstar/blog/513186 Curl 纯文本格式输出: curl icanhazip.com curl ifconfig.me curl ...
- 几种在Linux下查询外网IP的办法(转)
Curl 纯文本格式输出: curl icanhazip.com curl ifconfig.me curl curlmyip.com curl ip.appspot.com curl ipinfo. ...
- Linux下查询外网IP的办法。
Curl 纯文本格式输出:curl icanhazip.comcurl ifconfig.mecurl curlmyip.comcurl ip.appspot.comcurl ipinfo.io/ip ...
- linux下获取外网IP
使用阿里云或者有多个网卡IP的机器需要取外网IP时,可以用下面这种 wget -qO - ifconfig.co 更多方法参考:https://yq.aliyun.com/ziliao/105999
- linux 下查看外网ip
1. curl ipinfo.io ~/codes/qt_codes/qt-5.4.1-build$ curl ipinfo.io{ "ip": "114.241.21 ...
- linux下的外网木马前期要的工具
这周看了demon哥的博客弄msf外网马,自己试了一下 首先去ngrok官网下载对应的系统版本,如果对应下载那个标签是绿色的(这里不支持windows) 下载好后在linux提取出来 让我们来看看他的 ...
- linux下查询域名或IP注册信息的操作记录(whois)
在运维工作中,有时需要查询某些域名的注册信息(域名的NS,注册用户,注册邮箱等),可以使用whois这个命令.whois命令令用来查找并显示指定帐号(或域名)的用户相关信息,因为它是到Network ...
- Linux服务器查看外网IP地址的命令
可以直接输入如下几个命令:1.curl ifconfig.me2.curl cip.cc3.curl icanhazip.com4.curl ident.me5.curl ipecho.net/pla ...
- 查看Linux机器的外网IP
curl icanhazip.comcurl ifconfig.mecurl curlmyip.comcurl ip.appspot.comcurl ipinfo.io/ipcurl ipecho.n ...
随机推荐
- 【论文笔记】Leveraging Datasets with Varying Annotations for Face Alignment via Deep Regression Network
參考文献: Zhang J, Kan M, Shan S, et al. Leveraging Datasets With Varying Annotations for Face Alignment ...
- [Algorithm] Array production problem
Given an array of integers, return a new array such that each element at index i of the new array is ...
- 走进C++程序世界------异常处理
一. 概述 C++自身有着很强的纠错能力,发展到现在,已经建立了比較完好的异常处理机制. C++的异常情况无非两种,一种是语法错误.即程序中出现了错误的语句,函数.结构和类,致使编译程序无法进行.还有 ...
- Python编程-基础知识-python项目包和文件的管理以及如何引用相对路径的包和模块
目录 结构: core |____ __init__.py |____ basic |____ __init__.py |____ database |____ __init__. ...
- 【转】使用python进行多线程编程
1. python对多线程的支持 1)虚拟机层面 Python虚拟机使用GIL(Global Interpreter Lock,全局解释器锁)来互斥线程对共享资源的访问,暂时无法利用多处理器的优势.使 ...
- Linux crond实例
linux系统的定时任务: 1:linux系统自身定期执行的任务工作:系统周期性执行的任务工作,如轮询系统日志,备份系统数据,清理系统缓存等. [root@10-4-5-9 ~]# ll /var/l ...
- JDBC 关于Date格式
package test; import java.sql.Connection; import java.util.Date; import java.sql.PreparedStatement; ...
- MySQL比较两个表不同的数据
在本教程中,您将学习如何比较两个表以找到不匹配的记录. 在数据迁移中,我们经常需要比较两个表,以便在一个表中标识另一个表中没有相应记录的记录. 例如,我们有一个新的数据库,其架构与旧数据库不同.我们的 ...
- 对Ubuntu操作系统进行彻底优化
在安装Linux系统之初,就应该考虑怎样使Linux系统得到最好的性能.Linux本身也设计成可以良好扩展的形态,比如在Linux系统中,我们可以随心所欲地组织磁盘分区,有些朋友喜欢一个/,一个swa ...
- C#:DataGridView控件操作
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.W ...