title: Why do WCF endpoints ignore the hosts file?
body: <p>I have endpoints defined in a config file with a "fake" domain name.  The idea being that this would make deployment easier, since instead of modifying the config files, we simply set the ip address of the "fake" domain name on the enviroments' hosts files.  So for example, on my local dev box, I would have an entry in the hosts file </p>
  
  <pre><code>127.0.0.1       fake.domain
  </code></pre>
  
  <p>and on a user acceptance environment I might have</p>
  
  <pre><code>192.45.34.31    fake.domain
  </code></pre>
  
  <p>but in my config file I would just have the endpoint </p>
  
  <pre><code>&lt;endpoint address="http://fake.domain/someServiceBase/SomeService.svc" ... /&gt;
  </code></pre>
  
  <p>However, WCF seems to completely ignore the hosts file.  I can copy past the address into a browser, and it will come right up, but the WCF client (which is on the local dev box) will give a "host not found" error.</p>
  
  <p>Why does WCF ignore the hosts file?</p>
  
  <p><strong>Edit:</strong>
  Additional note, everything works if I replace the endpoint address to use the actual ip address directly in the config file, e.g.</p>
  
  <pre><code>&lt;endpoint address="http://127.0.0.1/someServiceBase/SomeService.svc" ... /&gt;
  </code></pre>