Hacker News new | ask | show | jobs
by lxgr 476 days ago
How so? Getting your public/external IP does not seem possible behind a NAT without an external service.
2 comments

No idea. All I can tell you is that it works and if I need to hard code a IP check like this then I’d rather rely on a big player like Google or cloudflare ns than someone’s project site
Not sure if I'd trust an undocumented Google feature without any SLA more, to be honest. Rumor has it that Google have discontinued a service or two before.
What command line do you use?
dig whoami.cloudflare ch txt @1.1.1.1 +short
You can use dig:

  dig +short -4 myip.opendns.com @resolver1.opendns.com
(still an external service, but not reliant on a website)
That's just another protocol in the end (DNS vs. HTTP), or am I missing something?

DNS also runs a higher risk of being cached or mangled somewhere along the way by middleboxes. HTTPS avoids that problem.