cURL 命令获取本机外网 IP
1.1 查询本机外网 IP
# curl dhcp.cn
134.175.159.160
1.2 输出格式为 JSON
# curl dhcp.cn/?json
{
"IP": "134.175.159.160",
"Address": {
"Country": "中国",
"Province": "广东省",
"City": "广州市"
},
"ISP": "电信"
}
1.3 输出格式为 JS
# curl dhcp.cn/?js
var returnIPResult = {"IP": "134.175.159.160","Address": {"Country": "中国","Province": "广东省","City": "广州市"},"ISP": "电信"};
1.4 输出格式为 YAML
# curl dhcp.cn/?yaml
IP: 134.175.159.160
Address:
Country: 中国
Province: 广东省
City: 广州市
ISP: 电信
1.5 输出格式为 IP
# curl dhcp.cn/?ip
134.175.159.160
1.6 输出格式为 CSV
# curl dhcp.cn/?csv
134.175.159.160,中国,广东省,广州市,电信
1.7 查询指定 IP
# dhcp.cn/?ip=134.175.159.160
IP: 134.175.159.160
Address:
Country: 中国
Province: 广东省
City: 广州市
ISP: 电信
cURL 命令获取本机外网 IP的更多相关文章
- 获取本机外网ip和内网ip
获取本机外网ip //获取本机的公网IP public static string GetIP() { string tempip = ""; try { WebRequest r ...
- 获取本机外网IP的工具类
ExternalIpAddressFetcher.java package com.tyust.common; import java.io.IOException; import java.io.I ...
- 用Linux命令行获取本机外网IP地址
引言:目前获取ip的方法中,ifconfig和ip获取函数得到的都是内网ip.有时候需要获取外网ip,目前通用的做法,是向外部服务器发送请求,解析外部服务器响应,从而得到的自己的外网ip.linux下 ...
- 获取本机外网ip
获取内网ip ifconfig eth0 | grep 'inet'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $2}' 获取公网ip ifc ...
- 获取本机外网IP的方式笔记
1.IP138 网址:http://www.ip138.com/: 分离出的快速查询地址:http://20140507.ip138.com/ic.asp(2014年8月9日有效) 个人经验:百度搜索 ...
- Linux命令行获取本机外网IP地址
问题: 服务器地址为net映射地址,本机ifconfig无法直接获取映射的公网地址. 方法: [root@TiaoBan- nidongde]# curl http://ifconfig.me 50. ...
- 【转】用Linux命令行获取本机外网IP地址
$ curl ifconfig.me $ curl icanhazip.com $ curl ident.me $ curl ipecho.net/plain $ curl whatismyip.ak ...
- java获取本机外网ip
public static String getV4IP(){ String ip = ""; String chinaz = "http://ip.chinaz.com ...
- 2019-11-17-dotnet-C#-获取本机外网-IP-地址
title author date CreateTime categories dotnet C# 获取本机外网 IP 地址 lindexi 2019-11-17 16:38:10 +0800 201 ...
随机推荐
- Excel表格中单击一个单元格如何将整行整列变色
视图->阅读模式 开启阅读模式后 就会显示如下情景,是的你点击任意单元格后,显示整行/整列
- docker run配置参数
Usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG...] -d, --detach=false 指定容器运行于前台还是后台,默认为false -i, - ...
- http请求在https中使用
问题原因:HTTPS页面里动态的引入HTTP资源,比如引入一个js文件,会被直接block掉的.在HTTPS页面里通过AJAX的方式请求HTTP资源,也会被直接block掉的. 解决方案: <m ...
- div居中和垂直居中的最简单方法
div居中方法: 1)对父盒子添加 text-align="center": 2)子盒子添加 margin:0 auto; 例子: body{text-align:center} ...
- Pycharm 使用问题一览
1. I'm not sure if it is the problem of Pycharm or any other IDE. 需要从本地文件中导入文件,但总是出现波浪线,按ctril点进去发现是 ...
- python mysql增加改查
#python mysql增加改查,方便日后copy/paste .......... 1 #encoding: UTF-8 2 import pymysql 3 # # 打开数据库连接 4 db = ...
- P7717-「EZEC-10」序列【Trie】
正题 题目链接:https://www.luogu.com.cn/problem/P7717 题目大意 求有多少个长度为\(n\)的序列\(a\)满足,都在\([0,k]\)的范围内且满足\(m\)个 ...
- LaTeX bib 引用为 作者 + 年份
将bib文件命名为ref.bib %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%% @Description: %%%%%%%% @Version: 1.0 %%%% ...
- Linux Bash命令杂记(tr col join paste expand)
Linux Bash命令杂记(tr col join paste expand) tr命令 tr命令可以将输入的数据中的某些字符做替换或者是作删除 tr [-ds] STR d: 删除输入数据的中的S ...
- 微软发布了Visual Studio 2022 RC版,并将在11月8日发布正式版
微软今天发布了Visual Studio 2022 最接近正式发布的RC版本,同时宣布在11月8日发布正式版,届时将在线上发布虚拟的发布活动,具体参见:https://devblogs.microso ...