title: WCF WebService / IIS Hosting & Configuration Issue Behind a Firewall
body: <p>I have a simple WCF Web service. It's hosted on IIS under the default website in our production domain. (local address: 10.10.20.100)</p>
  
  <p>By default this default website was setup for "All Unassigned" IP's on Port 80: however, I noticed that this caused the WCF Service to generate it's WSDL using the servers local DNS name. i.e. all the URIs in the wsdl were</p>
  
  <pre><code>http://myserver.subdomain.domain.com/.../...
  </code></pre>
  
  <p>This was no good as I need to expose this service to sites who have no knowledge of the production environments internal DNS. And this particular server doesn't have an external DNS Name. Just an external IP Address...</p>
  
  <p>I've had some success with changing the Setting in IIS from "All Unassigned" -> "10.10.20.100"</p>
  
  <p>This causes the Service to generate it's WSDL with the URIs </p>
  
  <pre><code>http://10.10.20.100/.../...
  </code></pre>
  
  <p>This is fine for other machines within the subdomain and on other subdomains but it's here that I get stuck. The servers External IP Address (1.2.3.4) is mapped through via some NAT/PAT translation so it isn't explicitly setup in the servers IP Settings (i.e. it doesn't show under IP Config)</p>
  
  <p>So if I change the IIS Default Website IP Address from "All Unassigned" -> "1.2.3.4" as I did for the internal address, then the WCF Service just comes back with... </p>
  
  <p><strong>Bad Request (Invalid Hostname)</strong></p>
  
  <p>And if I leave IIS Configured on the Internal IP Address, and try to access the service via the external IP Address I get</p>
  
  <pre><code>No protocol binding matches the given address 
  'http://1.2.3.4/TestService/Service.svc'. Protocol bindings are 
  configured at the Site level in IIS or WAS configuration
  </code></pre>
  
  <p>Is there any way to make IIS/WCF generate it's WSDL URI's with an external IP Address that isn't explicitly configured on the server ?</p>
  
  <p><em>Someone help me please before I dropkick WCF Services out the window.</em></p>