Curl 纯文本格式输出:
?
|
1
2
3
4
5
6
7 |
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格式输出:
?
|
1
2
3 |
curl ipinfo.io/json
curl ifconfig.me/all.json
curl www.trackip.net/ip?json (有点丑陋) |
curl XML格式输出:
?
|
1 |
curl ifconfig.me/all.xml |
curl 得到所有IP细节 (挖掘机)
?
|
1 |
curl ifconfig.me/all |
使用 DYDNS (当你使用 DYDNS 服务时有用)
?
|
1
2 |
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
?
|
1
2 |
wget http://ipecho.net/plain -O - -q ; echo
wget http://observebox.com/ip -O - -q ; echo |
使用 host 和 dig 命令
如果有的话,你也可以直接使用 host 和 dig 命令。
?
|
1
2 |
host -t a dartsclink.com | sed 's/.*has address //'
dig +short myip.opendns.com @resolver1.opendns.com |
bash 脚本示例:
?
|
1
2
3 |
#!/bin/bash
PUBLIC_IP=`wget http://ipecho.net/plain -O - -q ; echo`
echo $PUBLIC_IP |
感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!
原文链接:https://my.oschina.net/epstar/blog/513186
相关文章
猜你喜欢
- 64M VPS建站:怎样优化以提高网站加载速度? 2025-06-10
- 64M VPS建站:是否适合初学者操作和管理? 2025-06-10
- ASP.NET自助建站系统中的用户注册和登录功能定制方法 2025-06-10
- ASP.NET自助建站系统的域名绑定与解析教程 2025-06-10
- 个人服务器网站搭建:如何选择合适的服务器提供商? 2025-06-10
TA的动态
- 2025-07-10 怎样使用阿里云的安全工具进行服务器漏洞扫描和修复?
- 2025-07-10 怎样使用命令行工具优化Linux云服务器的Ping性能?
- 2025-07-10 怎样使用Xshell连接华为云服务器,实现高效远程管理?
- 2025-07-10 怎样利用云服务器D盘搭建稳定、高效的网站托管环境?
- 2025-07-10 怎样使用阿里云的安全组功能来增强服务器防火墙的安全性?
快网idc优惠网
QQ交流群
您的支持,是我们最大的动力!
热门文章
-
2025-05-29 67
-
微软改善 Linux 内核 6.6 版本中对于 Hyper-V 的支持,可带来额外安全性
2025-05-27 32 -
美国服务器搭建蜘蛛池业务的优势(美国服务器搭建蜘蛛池业务的优势有哪些呢)
2025-05-25 97 -
2025-06-04 95
-
2025-05-29 76
热门评论

