title: How does App-Engine disambiguate custom domains with wildcards?
body: <p>If I add a custom domain like <code>*.example.com</code> to my app-engine project, I can then selectively add CNAMEs to that domain pointing to ghs.googlehosted.com to forward subdomains to this project, which will then identify versions in the project.</p>
  
  <p>For example, if my project has a version called <code>www</code> and a version called <code>contact</code>, and I set the CNAMEs for <code>www.example.com</code> and <code>contact.example.com</code> to ghs.googlehosted.com, then <code>www.example.com</code> will be hosted by the <code>www</code>-version of my project and <code>contact.example.com</code> will be hosted by the <code>contact</code>-version of my project.</p>
  
  <p><em>For completeness: If I don't use the <code>*</code>, but instead add <code>www.example.com</code> and <code>contact.example.com</code> as custom domains to my project, both will be served according to the traffic allocation to the different project versions, whatever they may be.</em></p>
  
  <p>Now, things get interesting (and that's where my question comes in), if I add <code>*.example.com</code> as a custom domain to <strong>one</strong> project and <code>dataserver.example.com</code> to a <strong>different</strong> project. Now, Google App-Engine has to disambiguate whether <code>dataserver.example.com</code> refers to the <code>dataserver</code> version of the first project or to some version on the second project according to that project's traffic allocation.</p>
  
  <p>When I set this up a few months back, it did (what I think is) the most logical thing: It picks the latter, since <code>dataserver.example.com</code> is more specific than <code>*.example.com</code> and should thus take precedence. But when I tried to set up another set of projects yesterday, it instead tried to serve me the <code>dataserver</code> version of the first project (which initially didn't exist, and thus I got 404s, but when I deployed a dummy one, I got that back).</p>
  
  <p>Now the question is: What does App-Engine actually do? Is it random? Is it first-created, first-served? Is it by specificity, but might take a while to propagate to all servers?</p>