Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Michael Afanasiev
Courses Plus Student 15,597 PointsIP Geolocation (?) [Resolved]
Not really a programming question but thought maybe some expert can help me out.
I am looking for a way to check my IP geolocation using only internal operating system tools (e.g Terminal/Command Prompt) MacOS/Windows. Is there a way to do it? I know there are several websites that you can just check that but I am not interested in that.
Google was not my friend here unfortunately.
2 Answers
Ethan Rivas
9,979 PointsI don't know about this but maybe this thread would help you: http://hints.macworld.com/article.php?story=20100109053441706
Michael Afanasiev
Courses Plus Student 15,597 PointsEthan Rivas - I am back, and yay! I have a Windows answer as well!
Open PowerShell as admin and write:
curl ipinfo.io | select -ExpandProperty content
It will output the same result like terminal.
Ethan Rivas
9,979 PointsMichael Afanasiev Thanks for the tag, for what are you using this if I can know? :p
Michael Afanasiev
Courses Plus Student 15,597 PointsYou're welcome.
I will mainly use this at my work where we have way too many security polices. Some of our clients from time to time stumble upon an error that their location (by IP) is not valid for that product license. So before taking matters to more drastic solutions and workarounds, I would like to check where that geo block comes from, the ISP or the product license.
Plus, it's always good to know your way around the command-line!
Michael Afanasiev
Courses Plus Student 15,597 PointsMichael Afanasiev
Courses Plus Student 15,597 PointsThanks Ethan!! - although the article you linked did not help, it got me thinking of using different search terms and I was able to find a perfect solution for MacOS using the JSON API of ipinfo.io
curl ipinfo.ioGives the following results:
Now I need to find something similar from the Windows OS side! :D
Ethan Rivas
9,979 PointsEthan Rivas
9,979 PointsMichael Afanasiev That's cool! maybe that would help me for something in the future, If you find something for windows please tag me so I can read it too :P