国内公网ip

  • https://4.ipw.cn
  • https://ddns.oray.com/checkip
  • http://pv.sohu.com/cityjson?ie=utf-8
  • https://myip4.ipip.net/

国外公网ip

  • https://jsonip.com/
  • http://ip.42.pl/raw 或者 https://ip.42.pl/short
  • https://api-ipv4.ip.sb/ip
  • https://ip.3322.net/

应用场景:

可以编写一个DDNS。结合dns服务商的API,将动态的外网ip解析到固定的域名。