How to access a site in IIS with no DNS mapping

17,310

Solution 1

You will need to use host headers and create the appropriate DNS records to host multiple websites using the same IP Address.

edit: For example, you will need to create bindings for each site. Create a binding for port 80 and enter the www.mysite.com in the hostname field and create the dns entry (or setup a local hosts file for testing) to point to that IP Addres. Create a second binding for port 80 and enter www.myothersite.com in the hostname field and create the DNS entry.

In other words, you can't access those multiple sites without dns mapping or setting up the sites to bind on another port or IP Address

Solution 2

You can add host name(mySiteHostName.com) and IP address(101.22.23.01) in the binding.

You need to add entry in your client hosts file. C:\Windows\System32\drivers\etc\hosts file

101.22.23.01 mySiteHostName.com.

Now you can test in client machine without creating dns record.

Share:
17,310
CiccioMiami
Author by

CiccioMiami

Updated on September 18, 2022

Comments

  • CiccioMiami
    CiccioMiami over 1 year

    In my IIS 7.5 hosted in a Windows Server 2008 R2 I have several websites with no DNS address assigned. Let's take for instance the site (as named in IIS) with site name mySite. I have for this site the standard binding with no host name.

    enter image description here

    Suppose that my server IP address is, for instance, 101.22.23.01. Therefore it seems logic to me that in order to access the website, I should place in the address bar of my browser:

    [IP_address]/[sitename]
    

    in this case:

    101.22.23.01/mySite
    

    but it does not work. Shall I specify something else in the bindings?

  • CiccioMiami
    CiccioMiami over 11 years
    Thanks for your answer. However my purpose was to test the sites without creating a DNS record. Assume that all the sites use a different port, there should be some way to access them by using the IP address and let IIS route the request tot he appropriate site...
  • Rex
    Rex over 11 years
    if they are using a different port, you get to them by going to the port (mysite.com:81) if it's bound to port 81. hostheaders is the way IIS routes requests if they are bound to the same IP and port.
  • Rex
    Rex over 11 years
    In theory, you could setup a default page to process any request hitting the server, parse the data after and then redirect the user to the appropriate site.. but I think that's kludgey, prone to failure, and over complicating the issue.
  • CiccioMiami
    CiccioMiami over 11 years
    sorry, I edited my question mayeb now it looks more clear
  • Rex
    Rex over 11 years
    edit: Based on the picture of the binding, you can just go to 101.22.23.01 and it will go to that site.
  • CiccioMiami
    CiccioMiami over 11 years
    and if I have two websites, one with the binding like the picture and one with port 88?
  • Rex
    Rex over 11 years
    the second one would be http:// 101.22.23.01:88