There are several things that allow you to create such a db, if you invest enough time:
- Use the databases provided by regional and local registries to find an IP’s owner.
- Many ISPs use a naming schema that allows you to locate the user. Sometimes you can even read the city name in plain text if you do a reverse-DNS lookup. Sometimes it is more cryptic. For example I currently have p5dcf6c4a.dip.t-dialin.net , and I have no idea that the naming scheme is..
- Use a traceroute. If you can’t identify the location of a user, you can still find out the location of its uplink