命令行获取公网IP的方法

通过wget访问ipconfig.co查看

wget -qO - ifconfig.co

通过curl来获取公网IP

如果没有curl,要先下载安装curl

yum install curl -y

使用curl命令查询

使用已下任意一条命令均可(不保证所有查询网站均有效)

curl http://members.3322.org/dyndns/getip
curl ip.6655.com/ip.aspx
curl ifconfig.me
curl icanhazip.com
curl ident.me
curl ipecho.net/plain
curl whatismyip.akamai.com
curl myip.dnsomatic.com

 使用cip.cc查看自己ip和地区

命令行查询(详细):
UNIX/Linux:
#curl cip.cc
Windows:
>telnet cip.cc
>ftp cip.cc
命令行查询(纯ip):
UNIX/Linux:
#curl ip.cip.cc
浏览器查询其他IP:
URL	: http://www.cip.cc/IP
示例:
URL	: http://www.cip.cc/182.246.145.129

 

查看其他IP地址归属地

使用curl命令:

curl ip.cn/IP

示例:

curl ip.cn/www.baidu.com
IP:14.215.177.38 来自:广东省广州市 电信

curl ip.cn/www.zhihu.com
IP:118.178.213.186 来自:浙江省杭州市 阿里云

curl ip.cn/210.51.12.173
IP:210.51.12.173 来自:北京市 通泰大厦联通IDC

 

版权声明:
作者:WaterBear
链接:https://l-t.top/2207.html
来源:雷霆运维
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>
文章目录
关闭
目 录