r/shittyprogramming • • Sep 26 '23

Discovered this brilliantly written Powershell script at my last job

Post image
80 Upvotes

20 comments sorted by

View all comments

Show parent comment

3

u/jen1980 Sep 27 '23

That returns the A record for particular DNS entry. That does not tell you your external IP address, as I said.

5

u/jantari Sep 27 '23

No, it does in fact return your external IP address.

The DNS server chooses what IP to return to you. For this particular domain OpenDNS don't look it up in a database but just return your public source IP back as the answer. Quite neat.