Fully configure host header for Web application (Step-by-Step)

In category SharePoint | June 21, 2011

Host header (aka domain names or host names) lets you assign more than one site to a single IP address on a web application hosted in the IIS Web server. In SharePoint, you may need specific name for your website e.g. http://thuansoldier.net/ instead of an ugly URL like http://thuansoldier:32431. Having a friendly URL probably makes your end-users much easier to access SharePoint. They don’t have to remember the port number

In this article, I’m going to show you how to configure Host Header in SharePoint through DNS configuration and IIS. You can also use PowerShell script I’ve written here.

Create new Web application

Open Central Administration > Application Management > Manage web applications (under Web Applications). Click New in Ribbon.

Select Classic Mode Authentication by default but you can go with claims-based authentication to leverage tons of capabilities from it. Under Name, type the name of the new Web application.  Use default port 80 as it will be used through HTTP. You can select another port but make sure it doesn’t conflict with any common port (e.g. 21..). Under Host Header, type the full domain of the web application you are going to use.

At Security Configuration settings, keep all by default all.

Use existing application pool (optional) Under Database Name at the Database Name and Authentication, remove GUID and keep the name of content database as simple as possible.

Select service application connection if you have and then click OK to create new Web application.

Register the host header in DNS Server

In DNS server, create new host A by click New Host (A or AAA)

Type host name under Name, and the SharePoint server’s IP address. Click Add Host.

Configure host header for a Web application

In IIS Manager, right click the Web application you need to assign host header to and then click Edit Binding. In Site Bindings dialog box, click Edit. At IP address option, select IP address of the SharePoint server. Under Host name, type your host name. Click OK.

Open Central Administration > Application Management, under Web Applications , click Configure alternate access mappings. Verify that the URL for the default zone is set correctly.

However, when you open portal.ict24h.net whether in Internet Explore 8 or Mozilla Firefox 3.5, you will encounter 404 Page Not Found error. What’s up? Yes, you haven’t created Site collection in your Web application yet.

At Central Administration, click Application Management > Create site collections (under Site Collections). Please notice your Web application that you have just created namely portal.ict24h.net.

Finally, check your website with the friendly URL

I want to share basics in this post because I saw some questions about it in SharePoint 2010 – Setup, Upgrade, Administration and Operation.

I hope this post helps everyone.

2:10 GMT +7 June 22, 2011

You might need to read the series of setting up SharePoint 2013 environment At Work

 

Share

37 thoughts on “Fully configure host header for Web application (Step-by-Step)

  1. Denis says:

    Soon will be useful for me, thanks!

    1. Kerriann says:

      You’re a real deep thikner. Thanks for sharing.

  2. Pingback: SharePoint Maze
  3. Sergio says:

    Hi Thuan, thanks for the post, but what happen when you want to change the host header of an existing web application?

    1. What happen did you see? I changed the host header in existing web application successfully . After you configure host header for existing web application, you must restart DNS to update A record and reset IIS by using iisreset command. It will be get things done.

  4. Aryan Nava says:

    Best Alternate Access Mapping post in Internet

  5. Junaid says:

    Very nice post. Thanks dude. keep up the good work… :)

  6. Towerblock says:

    Really nicely written! I tried though and am having a problem. After creating Web Application, Site Collection, updating DNS when I go to the new website I get prompted for login credentials. I try logging in as the administrator and it never lets me in. Any ideas?

  7. Karthick says:

    What if, the SharePoint 2010 Web Application is on a different port number, other than 80? like 2222 for example?

  8. Salman says:

    Thanks for making our lives easier.
    Though I am getting a login error when I try to login.
    Any idea, it shows the login window.

  9. Salman says:

    Just used this article and it worked out wonderful.
    Except I got a login window for authentication.
    Use the following url to solve the issue.
    http://support.microsoft.com/kb/896861

    Thanks again to Thuan Soldier !

    Cheers
    Salman

  10. Software says:

    Hello There. I discovered your weblog using msn. This is a very neatly written article. I will be sure to bookmark it and come back to read more of your helpful information. Thank you for the post. I’ll definitely return.

  11. shashi kumar says:

    how about creating 3 web applications on different ports..can we map to different DNS or IP addressess..and how this will behave in production with NLB balanced.. Please give some insight..

  12. Bisi says:

    I followed this step and was able to create web application and site collection. However, I cannot login to the top level site collection, it kept on bringing the login box. Any help will be appreciated.

    Thank.

    1. Valentine Nzekwe says:

      Hi Bisi, to fix your issue try the following below,

      If you get a prompt for the user and you may face the following issues:

      •There is continuous prompt for the credentials
      •HTTP 401.1 error

      This shows that there is a problem with the Loopback configuration. This case should occur only when we access the application from the server machine.

      For fixing the problem we have to disable Loopback value inside registry.

      Open Registry Editor (regedit.exe) and locate the following key:

      HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa

      Create a new Key Value of type DWORD inside it and set the value to 1

      Good luck!

      1. Valentine Nzekwe says:

        sorry the DWORD to create is DisableLoopbackCheck and set the value to 1

        1. Amaru Di says:

          Thank you
          it worked >>>

        2. Pablo Melvin says:

          Thanks Valentine. You help me a lot.

  13. Sagar says:

    It helped me a lot. Thanks for your posting.

  14. Ashraf says:

    Hi,
    Thank you a lot for a really great post.
    It was so clear and pedagogical post which helps me to save hours and headacke.

    Thanks again

    //Ashraf

  15. surekha says:

    Thanks . It resolved my errors

  16. attila79 says:

    I have an enviroment SharePoint Server 2010 in virtual machine. My host system is Windows 7 64 professional. Is it possible access the host header deployed in the guest system SharePoint by the host system? Because I tried following your instructions but it only works inside the virtual machine..
    I modified the file host inside windows 7 but I keep getting error during access…
    Thanks

    1. You will be able to configure host header in your case. Just need to edit the file host like the following example:

      127.0.0.1 http://www.abc.com

      After editing, reset IIS > iisreset /nofoce

  17. Peter Dao says:

    Hello Guys

    I have setup my host header as http://mysharepoint.company.com and the admin person has set

    the IP to 10.10.150.20

    1. Create SP WebApp using this host http://mysharepoint.company.com with port 80

    2. Alter Mapping is pointing to this URL http://mysharepoint.company.com

    3. I use IIS7 to bind the URL http://mysharepoint.company.com with this IP 10.10.150.20

    I still have problem to get the SP site collection as sites/dst

    http://mysharepoint.company.com
    http://mysharepoint.company.com/sites/dst/
    http://mysharepoint.company.com:80/sites/dst/
    Have tried to set the registry with BackConnectionHostnames with the following URL values

    http://mysharepoint.company.com
    http://mysharepoint/
    The error message cannot display the web page.

    Please advise.

    Thanks,
    Peter

    1. Hi Peter,

      Can you please ping to your website to see it is resolvable.

  18. Peter Dao says:

    Hi guys,

    I have followed all the steps and I am getting this message: This page can’t be displayed.
    It looks it could not get to the site collection.

    Peter

  19. Peter Dao says:

    Hi Thuan,
    Thanks for getting back quickly.
    Yes. I have tried to Ping the IP address and have problem on IP resolved.

    I also tried to use http://10.10.150.20/sites/dst/

    It is same error cannot display the web page.

    Peter

    1. Do you have any problem with IP resolve? Does the SharePoint site get resolved on the associated IP? Is there any website that uses the same port?

  20. Peter Dao says:

    Hi Thuan,

    I have reported to IT and it seems like there is a problem with the DNS failure or load balance issues.
    I can ping the IP and could not get to the SP site. This is port 80 and it is available.
    I will let you know if this is DNS issue.

    Do you any tools that I can check my subhost is configured correctly?

    I cannot access the Production DNS server.
    Thanks,
    Peter

Leave a Reply