I have a domain and hosting. Say www.domainA.com. And I have domainB.com domain. I want to use the hosting space of domainA.com. Can I do something that I create directory with the name domainB on the / root directory of domainA.com. And map my domainB.com with domainB directory. 

Like both fetches same result:

www.domainA.com/domainB
www.domainB.com --> redirects to domainA hosting

Any suggestions on it?

Thanks.