Seriously there is only one way and it's advanced.
You have install this api on your server from root.
http://www.maxmind.com/app/country
See countries don't have set i.p.'s so you need a company to keep track month otherwise when Chinese company sales, loses, or moves their i.p.'s and a American company picks them up it will cause a problem, ect.. I.p.'s can change frequently.