Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set up subdomains on IIS 7

I have a website sitting on an IIS 7 server: WWW.example.COM

I would like to create several sub domains that looks like SUBDOMAIN1.example.COM

I created an IIS website and I set the bindings to be http, port 80, the ip address of my server, and SUBDOMAIN1.example.COM and the physical path to a folder under example.COM

I restarted my website and clicked on browse, the browser than opened with the address: http://SUBDOMAIN1.example.COM

But the website doesn't show up.

Do I have to do something with the DNS?

like image 978
Tal Cohen Avatar asked Nov 01 '10 13:11

Tal Cohen


People also ask

How do I bind a subdomain in IIS?

Before configuring IIS to point to a subdomain, such as sub1.example.com, you need to configure your DNS server to point the subdomain to the IP address of your IIS web server. For example, your DNS configuration would look something like this: a record - 192.168. 0.2 - www.example.com.


1 Answers

This one drove me crazy... basically you need two things:

1) Make sure your DNS is setup to point to your subdomain. This means to make sure you have an A Record in the DNS for your subdomain and point to the same IP.

2) You must add an additional website in IIS 7 named subdomain.example.com

  • Sites > Add Website
  • Site Name: subdomain.example.com
  • Physical Path: select the subdomain directory
  • Binding: same ip as example.com
  • Host name: subdomain.example.com
like image 178
DotNetMensch Avatar answered Sep 28 '22 20:09

DotNetMensch