How to access a site in IIS with no DNS mapping
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.
CiccioMiami
Updated on September 18, 2022Comments
-
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.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 over 11 yearsThanks 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 over 11 yearsif 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 over 11 yearsIn 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 over 11 yearssorry, I edited my question mayeb now it looks more clear
-
Rex over 11 yearsedit: Based on the picture of the binding, you can just go to 101.22.23.01 and it will go to that site.
-
CiccioMiami over 11 yearsand if I have two websites, one with the binding like the picture and one with port 88?
-
Rex over 11 yearsthe second one would be http:// 101.22.23.01:88