How do I extract the host name from a URL?
In the general case, you can't.
You can extract a domain name, but more often than not that will resolve (via DNS) to an IP address. That IP address will represent either one or a cluster of machines at an ISP, which handle the traffic for multiple (possibly thousands of) domains; those machines might have one or more host names from the POV of the ISP but this might or might not be public.
If you were running the system yourself, you might be telling people that your URL was something like
http://www.thaddy.co.uk In that particular case, the hostname would be www and the domain would be thaddy.co.uk (Thaddy, sorry for coopting and mangling your example).
MarkMLl