I want to track the country of the visitors and then redirect them to appropriate subdomains of my site like what google does...
And upto what extent i can rely on the d
Dependent on the granularity to which you want to divide your client "world" and the number of possible targets (subdomains) you could use the data provided in the IP-to-country database or MaxMind.com's Free Geolocation Database, place it into an SQL table and then use a small script to perform a lookup on the visitor's IP address and redirect as required.
The data will never be 100% accurate, especially if any of your visitors access your site via proxies or other anonymisers (in which case the IP address you see is not their true address). If you do implement this, I would suggest that allowing the user to correct (or simply override) the regional redirection would be worth including.