cURL 命令获取本机外网 IP

此功能仅用于查看本机公网地址,请勿用于其他用途,并遵守中国法律法规。

1.1 查询本机外网 IP

# curl dhcp.cn
134.175.159.160

1.2 输出格式为 JSON

# curl ip.dhcp.cn/json
{
  "IP": "134.175.159.160",
  "Address": {
    "Country": "中国",
    "Province": "广东省",
    "City": "广州市"
  },
  "ISP": "电信"
}

1.3 输出格式为 YAML

# curl ip.dhcp.cn/yaml

IP: 134.175.159.160
Address:
  Country: 中国
  Province: 广东省
  City: 广州市
ISP: 电信

1.4 输出格式为 IP

# curl ip.dhcp.cn/ip

134.175.159.160

1.5 输出格式为 CSV

# curl ip.dhcp.cn/csv

134.175.159.160,中国,广东省,广州市,电信

1.6 查询指定 IP

#curl ip.dhcp.cn/query?ip=134.175.159.160

{
  "IP": "134.175.159.160",
  "Address": {
    "Country": "中国",
    "Province": "广东省",
    "City": "广州市"
  },
  "ISP": "电信"
}
Copyright © 一条鱼 2019 赣ICP备19001536号-2 | 本站文章皆为原创,转载需申明出处。 all right reserved,powered by Gitbook最后修订日期: 2021-06-14 21:36:40

results matching ""

    No results matching ""