You could install something like
Maxmind GeoLiteCity (free), use one of the available bindings (I would recommend the PHP libraries over the apache alternative), and write a little PHP to do this.
Installing Maxmind and the bindings is a hands-on experience. If you're on *NIX, you'll need shell access, probably root(?) and a lil'bit of know-how.