A host-named site collection allows you to address a site collection with a unique DNS name.
SharePoint decides the mapping of the host nName with the Site Collection at the time of initializing SPSite Object. During the initialization process, SharePoint queries SPWebApplication object to see if host header details are associated with the Site Collection and if there is no information returned on host headers, then it becomes evident that this is a typical Site Collection.
If we inspect the ULS logs for Site Collections with host headers, we will see the entries like Site lookup, which has found the host header site. On the other hand, if we inspect the same logs for Site Collections without host headers looking up the additional information about the typical site http://serverName:Port/sites/site001
In this article, we will look into the steps to create host header based Site Collections, as per the process given below.

Step 1
- Search for DNS on Windows Server.

- Select the domain name.
- Right click and select New Host.

- Enter new host name.
- Enter IP address of the Hosting Server.
- Click Add Host.

This will add a new host name entry in the DNS Catalog.

Step 2
Since we don’t have Web UI available to create the host header based Site Collections, so the only option with which we are left with is PowerShell only.
PowerShell command, which we can use to create a host header based Site Collection is given below.
- New-SPSite “http://developerWorkspace001.PRASHANT.LOCAL”; -HostHeaderWebApplication “http://developmentportal.prashant.local:2016”; -Name “Developers Workspace 001” -OwnerAlias “Prashant\Administrator” -Template “DEV#0”
In this command, we have the parameters and their values given below.

Once you execute PowerShell, we can see the output given below.











Rene WagnerPosted Sep 27, 2017, 5:45 PM
Nice post, but I'm somewhat confused -- at the end, to access the site, you say you entered the URL "http://developerWorkspace001.PRASHANT.LOCAL" (no port #). But after the login, it shows the URL "http://developerWorkspace001.PRASHANT.LOCAL:2016" (with port #). I tried using no port #, but I get a "Webpage cannot be found" error ... ONLY if I add the port # will it work. Should this work without port # (assuming a non-std port such as 2016)?
Prashant BansalPosted Jul 14, 2017, 12:42 PM
Glad you find it helpful.
Vinodh NarayananPosted May 5, 2017, 2:24 AM
Good one thanks for sharing