You can achieve this using Host Named Site Collections.
Microsoft SharePoint Foundation 2010 supports both path-based and
host-named site collections. The primary difference between path-based
and host-named site collections is that all path-based site
collections in a Web application share the same host name (DNS name),
and each host-named site collection in a Web application is assigned a
unique DNS name.
Path-based site collections provide a corporate hosting solution with
all site collections sharing the same host name of the Web
application. In a path-based deployment, you can have a single site
collection at the root of the Web application and additional site
collections under managed paths within the Web application.
Host-named site collections provide a scalable Web hosting solution
with each site collection assigned to a unique DNS name. In a Web
hosting deployment, each host-named site collection has its own vanity
host name URL, such as http://customer1.contoso.com,
http://customer2.contoso.com, or http://www.customer3.com.
SharePoint Foundation 2010 provides two significant improvements to
host-named site collections: the ability to use managed paths with
host-named site collections, and the ability to use off-box SSL
termination with host-named site collections.