Small, dependency-free Go helper to discover your machine’s public IPv4 quickly and reliably. It races three strategies under a short overall timeout and returns the first winner:
- OpenDNS (
myip.opendns.comA lookup via OpenDNS resolvers) - Google DNS (TXT on
o-o.myaddr.l.google.comvia Google authoritative NS) - HTTP (plain-text IP from several well-known endpoints)
Each strategy is isolated with short dial/read timeouts and early cancellation. You can supply your own resolvers and tweak the overall budget via functional options.