title: Selenium.WebDriverException: Message: unknown error: net::ERR_NAME_NOT_RESOLVED
body: <p>I am trying to user latest selenium hub in docker and try to run pytests in docker or without it for debug.
  I set up selenium according to official documentation.
  I used 3 version for docker compose: <a href="https://github.com/SeleniumHQ/docker-selenium/blob/trunk/docker-compose-v3.yml" rel="nofollow noreferrer">https://github.com/SeleniumHQ/docker-selenium/blob/trunk/docker-compose-v3.yml</a></p>
  <p>Containers started fine:
  <a href="https://i.stack.imgur.com/7vtFM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7vtFM.png" alt="enter image description here" /></a></p>
  <p>Also health check is ok:</p>
  <pre><code>{
    &quot;value&quot;: {
      &quot;ready&quot;: true,
      &quot;message&quot;: &quot;Selenium Grid ready.&quot;,
      &quot;nodes&quot;: [
        {
          &quot;id&quot;: &quot;9b050c95-76e1-4ed3-be7e-a320630fdf1e&quot;,
          &quot;uri&quot;: &quot;http:\u002f\u002f192.168.32.4:5555&quot;,
          &quot;maxSessions&quot;: 8,
          &quot;stereotypes&quot;: [
            {
              &quot;capabilities&quot;: {
                &quot;browserName&quot;: &quot;chrome&quot;
              },
              &quot;count&quot;: 8
            }
          ],
          &quot;sessions&quot;: [
          ]
        },
        {
          &quot;id&quot;: &quot;d4e6d3a1-140d-41c9-b9c6-38fd5b6677b5&quot;,
          &quot;uri&quot;: &quot;http:\u002f\u002f192.168.32.5:5555&quot;,
          &quot;maxSessions&quot;: 8,
          &quot;stereotypes&quot;: [
            {
              &quot;capabilities&quot;: {
                &quot;browserName&quot;: &quot;firefox&quot;
              },
              &quot;count&quot;: 8
            }
          ],
          &quot;sessions&quot;: [
          ]
        }
      ]
    }
  }
  </code></pre>
  <p>I am trying to start tests via pycharm (not in docker) on localhost:4444 and receive next error:</p>
  <pre><code>self = &lt;selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x7fe353e9c0d0&gt;
  response = {'status': 500, 'value': '{&quot;value&quot;:{&quot;error&quot;:&quot;unknown error&quot;,&quot;message&quot;:&quot;unknown error: net::ERR_NAME_NOT_RESOLVED\\n  (Session info: chrome=85.0.4183.83)&quot;,&quot;stacktrace&quot;:&quot;#0 0x56398a84caa9 \\u003Cunknown&gt;\\n&quot;}}'}
  
  </code></pre>
  <p>Browser version for chrome is 85.0.4183.83
  I start browser in conftest.py:</p>
  <pre><code>browser = webdriver.Remote(
              command_executor=f&quot;http://{os.environ['SE_EVENT_BUS_HOST']}:4444/wd/hub&quot;,
              desired_capabilities={
                  'browserName': browser_name
              }
          )
  </code></pre>
  <p>I tried to set localhost there as well as selenium-hub.
  In docker compose I also added pytests section to try set up tests in docker:</p>
  <pre><code>  pytests:
      container_name: selenium_pytests
      #    network_mode: host
      command: /bin/sleep infinity
      build: .
      environment:
        - SE_EVENT_BUS_HOST=selenium-hub
      volumes:
        - ./reports:/opt/app/reports
  </code></pre>
  <p>While running pytests in docker I do not see hub. Trying to check by selenium-hub and localhost as well:
  <a href="https://i.stack.imgur.com/Cxq5Z.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Cxq5Z.png" alt="enter image description here" /></a></p>
  <p>My wait-for-it.sh:</p>
  <pre><code>#!/bin/bash
  # wait-for-grid.sh
  
  set -e
  
  cmd=&quot;$@&quot;
  
  while ! curl -sSL &quot;http://selenium-hub:4444/wd/hub/status&quot; 2&gt;&amp;1 \
          | jq -r '.value.ready' 2&gt;&amp;1 | grep &quot;true&quot; &gt;/dev/null; do
      echo 'Waiting for the Grid'
      sleep 1
  done
  
  &gt;&amp;2 echo &quot;Selenium Grid is up - executing tests&quot;
  </code></pre>
  <p>Tried curl there: localhost, selenium-hub.</p>
  <p>Previously I was using environment HUB_HOST=hub. That works for me for running tests in docker but I got same error ERR_NAME_NOT_RESOLVED for running tests out of docker.</p>