cURL 命令获取本机外网 IP

1. 查询本机外网 IP

1.1 输出格式为 JSON

# curl api.dhcp.cn/?json

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

1.2 输出格式为 YAML (Defalut)

# curl api.dhcp.cn/?yaml

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

1.3 输出格式为 IP

1.4 输出格式为 CSV

2. 查询指定 IP

Last updated