For example my site collections structure is as follows:
http://testserver1.com/sites/sitecollection1
http://testserver1.com/sites/sitecollection2
http://testserver1.com/sitecollection3
http://testserver1.com/team/sitecollection4
I want to get http://testserver1.com (host header) from the code? how can I do it using object model? Is there a problem if we have Alternate access mapping being configured on these site collections as well?