I need to get the Domain name of an given URL.
1. http://shopping.rediff.com/ --> Here domain name is Rediff
2. http://sportsillustrated.cnn.com/?cnn=yes --> Here CNN
3. http://edition.cnn.com/ --> Here CNN
4. http://en.wikipedia.org/ --> Here Wikipedia
5. http://search.cpan.org/ --> Here CPAN
I need a Generalized method to get the domain name.