title: Docker for Windows - container domain name cannot be resolved
body: <p>I want to set up developer environment on local machine with <code>docker-compose</code>. And I'm trying to assign some predefined domain names for my sites. It must be a three level domain like <em>app1.myapps.test</em>, instead of just <em>app1</em>.</p>
  
  <p>I want Docker to assign these host names automatically using two properties <em>hostname</em> and <em>domainname</em>, instead of assigning static IPs to containers and adding these IPs to <code>hosts</code> file manually.</p>
  
  <p>My Docker compose file is:</p>
  
  <pre><code>version: '3'
  services:
    app1:
      build: .
      container_name: app-1
      domainname: myapps.test
      hostname: app1
  </code></pre>
  
  <p>Trying to open <a href="http://app1.myapps.test/" rel="nofollow noreferrer">http://app1.myapps.test/</a> and see error telling me that DNS address could not be resolved.
  If I remove property <code>domainname: myapps.test</code> then it works fine and I'm able to access my site by hostname <a href="http://app1/" rel="nofollow noreferrer">http://app1/</a>.</p>
  
  <p>Changing settings to (without domainname)</p>
  
  <pre><code>hostname: app1.myapps.test
  </code></pre>
  
  <p>or to</p>
  
  <pre><code>domainname: myapps.test
  hostname: app1.myapps.test
  </code></pre>
  
  <p>didn't help as well.</p>
  
  <p>Is there a way for Docker DNS to set multi-level domains and how option <code>domainname</code> works? Am I missing something?</p>