{"id":712,"date":"2026-08-30T23:12:27","date_gmt":"2026-08-30T23:12:27","guid":{"rendered":"https:\/\/windows-vps.org\/blog\/?p=712"},"modified":"2026-09-26T22:06:44","modified_gmt":"2026-09-26T22:06:44","slug":"running-iis-windows-server-beginners-guide","status":"publish","type":"post","link":"https:\/\/windows-vps.org\/blog\/running-iis-windows-server-beginners-guide\/","title":{"rendered":"IIS Host Header Bindings: Serving Exactly One Canonical Hostname on a Windows Server"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">An IIS site that answers on every hostname your VPS responds to is a common and avoidable misconfiguration. On a Windows Server VPS the default site binds to <code>*:80<\/code> \u2014 all unassigned IPs, all hostnames. That is fine on a laptop. In production it means <code>https:\/\/windows-vps.org\/blog\/<\/code>-style canonical hostnames, an IP address, and random subdomains all serve the same content, which splits crawl budget, breaks cookies, and leaks internal hostnames to scanners.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For a working reference architecture, see the hosting context on <a href=\"https:\/\/windows-vps.org\/\">windows-vps.org<\/a>. This article is the technical how-to: one bindings model that makes every request resolve to exactly one canonical hostname, then redirect anything that does not match.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why a catch-all binding is a real problem<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">When IIS has no bindings that match the incoming <code>Host<\/code> header, it falls back to the first site that has a matching IP and port. Attackers and crawlers exploit this consistently:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Duplicate content:<\/strong> <code>https:\/\/203.0.113.10\/<\/code>, <code>https:\/\/www.example.com\/<\/code>, and <code>https:\/\/example.internal\/<\/code> all return HTTP 200 with identical HTML.<\/li>\n<li><strong>Cookie leakage:<\/strong> cookies scoped to <code>.example.com<\/code> are sent to any subdomain pointing at the same server, including ones you never intended to expose.<\/li>\n<li><strong>TLS misrouting:<\/strong> with SNI, a request for an unknown hostname may land on the wrong certificate and produce a name-mismatch warning that looks like your fault.<\/li>\n<li><strong>SEO dilution:<\/strong> search engines see several URLs for one page and split ranking signals between them.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1: Inventory what IIS is actually serving<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Start in an elevated PowerShell session. Enumerate every site and binding before you change anything:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Import-Module WebAdministration\nGet-Website | Select-Object Name, State, PhysicalPath, Bindings |\n    Format-List\n\nGet-WebBinding | Select-Object ItemXPath, protocol, bindingInformation |\n    Sort-Object bindingInformation<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Look for bindings where the hostname portion (the third field after the IP and port) is empty. An empty hostname is the catch-all. On a fresh VPS template you will usually see one site named <em>Default Web Site<\/em> with <code>*:80:<\/code> and nothing else.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2: Create explicit bindings for the canonical host only<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Decide on exactly one canonical hostname \u2014 the one you will publish, link, and put in your sitemap. Pick one form and never publish the other. Then add explicit bindings:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>New-WebBinding -Name \"MyApp\" -Protocol http  -Port 80  -HostHeader \"app.example.com\"\nNew-WebBinding -Name \"MyApp\" -Protocol https -Port 443 -HostHeader \"app.example.com\" `\n    -SslFlags 1   # 1 = SNI required<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>SslFlags 1<\/code> parameter is important on any VPS hosting more than one TLS site: it forces Server Name Indication so IIS selects the certificate by hostname rather than by IP address alone.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3: Catch everything else and return 444 or a redirect<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The cleanest pattern is three layers: the canonical site, a redirect site for the alternate form (<code>www<\/code> to apex, or the reverse), and an empty &#8220;reject&#8221; site bound to the catch-all binding that terminates unmatched traffic rather than serving content.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Incoming Host<\/th><th>Matching site<\/th><th>Result<\/th><\/tr><\/thead><tbody><tr><td>app.example.com<\/td><td>MyApp<\/td><td>200 \u2014 canonical, served<\/td><\/tr><tr><td>www.app.example.com<\/td><td>RedirectSite<\/td><td>301 to https:\/\/app.example.com<\/td><\/tr><tr><td>203.0.113.10 (raw IP)<\/td><td>RejectSite<\/td><td>Connection closed \/ 404<\/td><\/tr><tr><td>unknown.example.com<\/td><td>RejectSite<\/td><td>Connection closed \/ 404<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">IIS has no native 444 like nginx, but the equivalent behaviour is a catch-all site whose root is an empty folder holding a bare <code>web.config<\/code> that returns HTTP 404 with a null body and no server banner. Attackers who scan by IP stop learning anything useful about your deployment.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 4: Handle the port-443 blind spot<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Catch-all HTTPS is subtler than HTTP. A client requesting an unknown hostname over TLS will fail during the handshake before IIS can route it, unless a default certificate is configured. Bind the catch-all HTTPS site to a self-signed or generic certificate so the handshake completes and your rejection site can answer cleanly. Keep the certificate out of any path the public canonical site uses.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">HTTP\/3 and the host-header edge case<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you enable HTTP\/3 on IIS (Windows Server 2022 and later), the QUIC listener binds per-site and interacts with SNI differently from TCP. A site with a catch-all binding and HTTP\/3 enabled can behave inconsistently across clients \u2014 some browsers reach the reject site by accident. Keep HTTP\/3 enabled only on the canonical site, and re-run the host-header tests over both TCP and UDP after any protocol change.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Keeping the canonical set consistent across layers<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">IIS bindings are only one of three places a hostname is enforced. A hostname change that is not propagated everywhere creates exactly the redirect chains you set out to eliminate. Audit all three whenever you add a domain:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Layer<\/th><th>What to check<\/th><th>Tool<\/th><\/tr><\/thead><tbody><tr><td>DNS<\/td><td>A\/AAAA records point only at serving hosts<\/td><td><code>Resolve-DnsName<\/code><\/td><\/tr><tr><td>IIS<\/td><td>Explicit host-header bindings, SNI flag<\/td><td><code>Get-WebBinding<\/code><\/td><\/tr><tr><td>App<\/td><td>Generated absolute URLs use canonical host<\/td><td>App config \/ runtime test<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">An application that generates redirect URLs from the incoming <code>Host<\/code> header rather than a configured value is the most common source of accidental non-canonical URLs. Pin the public base URL in configuration so an attacker cannot force your app to emit links to a hostname they control.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Verification checklist<\/h2>\n\n\n\n<ol class=\"wp-block-list\"><li>Request the canonical host \u2014 expect HTTP 200 and correct content.<\/li>\n<li>Request the alternate (<code>www<\/code> or apex) \u2014 expect a single 301, never a chain of redirects.<\/li>\n<li>Request the raw IP \u2014 expect a rejection or 404, not your site.<\/li>\n<li>Request a made-up hostname with <code>curl -H \"Host: bogus.example.com\" https:\/\/your-ip\/ -k<\/code> \u2014 expect rejection.<\/li>\n<li>Confirm <code>curl -I https:\/\/canonical\/<\/code> returns no redirect and the expected <code>Strict-Transport-Security<\/code> header.<\/li><\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Host-header hygiene is one of those fixes that costs twenty minutes and closes an entire class of duplicate-content and information-disclosure issues. Do it before you point a real domain at the box, and it never becomes a problem later.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>An IIS site that answers on every hostname your VPS responds to is a common and avoidable misconfiguration. On a Windows Server VPS the default site binds to *:80 \u2014 all unassigned IPs, all hostnames. That is fine on a laptop. In production it means https:\/\/windows-vps.org\/blog\/-style canonical hostnames, an IP address, and random subdomains all &#8230; <a title=\"IIS Host Header Bindings: Serving Exactly One Canonical Hostname on a Windows Server\" class=\"read-more\" href=\"https:\/\/windows-vps.org\/blog\/running-iis-windows-server-beginners-guide\/\" aria-label=\"Read more about IIS Host Header Bindings: Serving Exactly One Canonical Hostname on a Windows Server\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":8,"footnotes":""},"categories":[5],"tags":[],"class_list":["post-712","post","type-post","status-publish","format-standard","hentry","category-tutorials-guides"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.1 (Yoast SEO v26.1) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>IIS Host Header Bindings: Serving Exactly One Canonical Hostname on a Windows Server - Windows VPS Blog<\/title>\n<meta name=\"description\" content=\"An IIS site that answers on every hostname your VPS responds to is a common and avoidable misconfiguration. On a Windows Server VPS the default site binds\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/windows-vps.org\/blog\/running-iis-windows-server-beginners-guide\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"IIS Host Header Bindings: Serving Exactly One Canonical Hostname on a Windows Server\" \/>\n<meta property=\"og:description\" content=\"IIS Host Header Bindings: Serving Exactly One Canonical Hostname on a Windows Server\" \/>\n<meta property=\"og:url\" content=\"https:\/\/windows-vps.org\/blog\/running-iis-windows-server-beginners-guide\/\" \/>\n<meta property=\"og:site_name\" content=\"Windows VPS Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-30T23:12:27+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-09-26T22:06:44+00:00\" \/>\n<meta name=\"author\" content=\"windows-vps\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@myxiechengxuan\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"windows-vps\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/windows-vps.org\/blog\/running-iis-windows-server-beginners-guide\/\",\"url\":\"https:\/\/windows-vps.org\/blog\/running-iis-windows-server-beginners-guide\/\",\"name\":\"IIS Host Header Bindings: Serving Exactly One Canonical Hostname on a Windows Server - Windows VPS Blog\",\"isPartOf\":{\"@id\":\"https:\/\/windows-vps.org\/blog\/#website\"},\"datePublished\":\"2026-08-30T23:12:27+00:00\",\"dateModified\":\"2026-09-26T22:06:44+00:00\",\"author\":{\"@id\":\"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/44caceed916d0db318aa08d5623a7a58\"},\"description\":\"An IIS site that answers on every hostname your VPS responds to is a common and avoidable misconfiguration. On a Windows Server VPS the default site binds\",\"breadcrumb\":{\"@id\":\"https:\/\/windows-vps.org\/blog\/running-iis-windows-server-beginners-guide\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/windows-vps.org\/blog\/running-iis-windows-server-beginners-guide\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/windows-vps.org\/blog\/running-iis-windows-server-beginners-guide\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/windows-vps.org\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"IIS Host Header Bindings: Serving Exactly One Canonical Hostname on a Windows Server\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/windows-vps.org\/blog\/#website\",\"url\":\"https:\/\/windows-vps.org\/blog\/\",\"name\":\"Windows VPS Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/windows-vps.org\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/44caceed916d0db318aa08d5623a7a58\",\"name\":\"windows-vps\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3f2573db5afcd1a6ab9abcc5d48fc8e42584bc87ab9d98cc156e5b2097766dd9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3f2573db5afcd1a6ab9abcc5d48fc8e42584bc87ab9d98cc156e5b2097766dd9?s=96&d=mm&r=g\",\"caption\":\"windows-vps\"},\"sameAs\":[\"https:\/\/windows-vps.org\/blog\",\"https:\/\/x.com\/myxiechengxuan\"],\"url\":\"https:\/\/windows-vps.org\/blog\/author\/myxiechengxuan\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"IIS Host Header Bindings: Serving Exactly One Canonical Hostname on a Windows Server - Windows VPS Blog","description":"An IIS site that answers on every hostname your VPS responds to is a common and avoidable misconfiguration. On a Windows Server VPS the default site binds","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/windows-vps.org\/blog\/running-iis-windows-server-beginners-guide\/","og_locale":"en_US","og_type":"article","og_title":"IIS Host Header Bindings: Serving Exactly One Canonical Hostname on a Windows Server","og_description":"IIS Host Header Bindings: Serving Exactly One Canonical Hostname on a Windows Server","og_url":"https:\/\/windows-vps.org\/blog\/running-iis-windows-server-beginners-guide\/","og_site_name":"Windows VPS Blog","article_published_time":"2026-08-30T23:12:27+00:00","article_modified_time":"2026-09-26T22:06:44+00:00","author":"windows-vps","twitter_card":"summary_large_image","twitter_creator":"@myxiechengxuan","twitter_misc":{"Written by":"windows-vps","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/windows-vps.org\/blog\/running-iis-windows-server-beginners-guide\/","url":"https:\/\/windows-vps.org\/blog\/running-iis-windows-server-beginners-guide\/","name":"IIS Host Header Bindings: Serving Exactly One Canonical Hostname on a Windows Server - Windows VPS Blog","isPartOf":{"@id":"https:\/\/windows-vps.org\/blog\/#website"},"datePublished":"2026-08-30T23:12:27+00:00","dateModified":"2026-09-26T22:06:44+00:00","author":{"@id":"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/44caceed916d0db318aa08d5623a7a58"},"description":"An IIS site that answers on every hostname your VPS responds to is a common and avoidable misconfiguration. On a Windows Server VPS the default site binds","breadcrumb":{"@id":"https:\/\/windows-vps.org\/blog\/running-iis-windows-server-beginners-guide\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/windows-vps.org\/blog\/running-iis-windows-server-beginners-guide\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/windows-vps.org\/blog\/running-iis-windows-server-beginners-guide\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/windows-vps.org\/blog\/"},{"@type":"ListItem","position":2,"name":"IIS Host Header Bindings: Serving Exactly One Canonical Hostname on a Windows Server"}]},{"@type":"WebSite","@id":"https:\/\/windows-vps.org\/blog\/#website","url":"https:\/\/windows-vps.org\/blog\/","name":"Windows VPS Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/windows-vps.org\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/44caceed916d0db318aa08d5623a7a58","name":"windows-vps","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/3f2573db5afcd1a6ab9abcc5d48fc8e42584bc87ab9d98cc156e5b2097766dd9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3f2573db5afcd1a6ab9abcc5d48fc8e42584bc87ab9d98cc156e5b2097766dd9?s=96&d=mm&r=g","caption":"windows-vps"},"sameAs":["https:\/\/windows-vps.org\/blog","https:\/\/x.com\/myxiechengxuan"],"url":"https:\/\/windows-vps.org\/blog\/author\/myxiechengxuan\/"}]}},"_links":{"self":[{"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/posts\/712","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/comments?post=712"}],"version-history":[{"count":4,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/posts\/712\/revisions"}],"predecessor-version":[{"id":802,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/posts\/712\/revisions\/802"}],"wp:attachment":[{"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/media?parent=712"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/categories?post=712"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/tags?post=712"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}