title: Why is ServerName not having any effect?
body: <p>I have several sites configured as VirtualHost. All of them are running on the same system, same IP address. I want apache to redirect requests to one or another VirtualHost based on the DNS. That is why I am using <a href="http://httpd.apache.org/docs/current/mod/core.html#servername" rel="nofollow">ServerName</a>. Quoting:</p>
  
  <blockquote>
    <p>If you are using name-based virtual hosts, the ServerName inside a
     section specifies what hostname must appear in the
    request's Host: header to match this virtual host.</p>
  </blockquote>
  
  <p>This is how my Virtual Host configuration looks like:</p>
  
  <pre><code>NameVirtualHost *:80
  &lt;VirtualHost *&gt;
  
      ServerName my.dns.net
  
      ....
  
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>But apache, instead of maching the requests as per DNS, is just redirecting requests to the first VirtualHost defined.</p>
  
  <ul>
  <li>Why is that?</li>
  <li>What can I do to force apache to do exact DNS matching?</li>
  </ul>