you need ip database and script to work with that db
http://www.maxmind.com/ has a pretty good geo db.
GeoIP Free Country
http://www.maxmind.com/app/geoip_country - is their free version
if you want simple blocking you may do it through htaccess, im not sure how exactly its done, i think i've seen something about it on maxminds site.
i can do php if needed.