text: how do websites know what city i am in?   when you visit a site, your ip address is given to the server computer.  that computer can then do a name look up on the ip address and see what provider supplied the ip address.  in the name look up, the provider city will be also listed and then they can echo that back to the web page display.