This magic is achieved by querying either one of two off-line, third-party GeoIP info DB, namely:
I tend to favor MaxMind's product, for its accuracy (resolution down to city name) and wider coverage.
MaxMind DB is updated regularly, *around* (but not always) the 1st Tuesday of each month.
To check the actual production date of the current downloaded DB version, one can either rely on the file time-stamp listed within the *.gz package,
or, even better, verify the hidden time-stamp buried deep-down the uncompressed *.dat file extracted from the *.gz package.
Here is a handy, very simple batch file to display this internal time-stamp:
Code: Select all
@echo off REM display Maxmind file time-stamp cs echo MaxMind GeoLiteCity.dat current version : echo: tail -c86 *.dat | grep -o -E "GEO.*Reserved" echo:
Well worth the 3.36Mb download:
'cs' is an antediluvian, microscopic (119 bytes !) one-trick pony *.com file, first published in PC Magazine by Charles Petzold, circa 1988, which, you guessed it,
just "Clears the Screen".
Of course, MS 'cls' (built into cmd.exe) does just the same, but 'cmd.exe' Goliath weights a hefty 389,120 bytes vs 'cs.com' David with a mere 119 bytes ...