0

I hosting a DNS zone for a public domain on my server (Windows Server 2008 R2). My problem is if user enter any sub domain name who is not available , can see my IIS default page.

for example :

blabla.mydomain.com or xxx.mydomain.com

can see my IIS default page.

i want to redirect user to main domain name if entered sub domain is not available. how can i handle this? i should config my DNS Zones or IIS?

1 Answers1

1

What's happening is this:

  1. Client looks up random subdomain of mydomain.com in DNS (random.mydomain.com)
  2. You have a wildcard DNS record that resolves that subdomain to the IP address for your main domain (mydomain.com)
  3. Client's browser connects to your server on that IP address, sending random.mydomain.com as the host header for the HTTP connection
  4. Because you have no matching binding for random.mydomain.com, IIS falls back to the binding for mydomain.com's IP address but with no host header. Right now that apparently matches your default IIS site with the built in "Welcome" page.

You need to add a binding to the site in IIS for your main domain that includes the IP address but no host header, and stop the default site (or remove the equivalent binding), so that visitors using unmatched host headers will be served the content from your main site.

phoebus
  • 8,380
  • 1
  • 31
  • 30