you'd either have to do a lookup on each ip (slow), or base the decision on which server the sees by country code in the tld (won't always be accurate).
personally i'd give the user the option of which server they want to connect to. user hits one server (your main server) then has the option to choose a server closer to them for better response time.