How does a DNS lookup site get my location perfect?
Solution 1:
There are many ways to get a good estimate of location, even without GPS.
If you have WiFi (e.g. a laptop, Wi-Fi Positioning System can be used to give fairly accurate location.
If you have other radios, e.g. GSM, triangulation can be used on cell towers.
These are on top of traditional IP to location mapping which others discussed, which gives your location typically up to the city or area - sometimes down to a zip code.
Finally, note that if someone wants to be super savy, they can match you against similar IPs they have seen before (who have provided location), and although you do not have location service/sharing on, they can find your location fairly accurately.
Also, see https://support.google.com/maps/answer/1725632?hl=en