How to Fix "lookup docker on port 53 no such host."?

Why do bugs always come up when the timing isn't great? I just checking out huginn and n8n. Both looked interesting to automate some daily pain away. While huginn ran without any issues, n8n gave me some headache. Here I hope to avoid the same for someone else!

I've run the following command to get nodemation, short n8n, up:

$ docker run -it --rm --name n8n -p 5678:5678 -v ~/.n8n:/home/node/.n8n n8nio/n8n

Unfortunately this little issue found it's way on my console:

docker: error during connect: Post http://docker:2375/v1.24/containers/create?
name=n8n: dial tcp: lookup docker on no such host.

My first hinge was that my hard-disk was running low on free space. A quick df -h relieved me from this worry: There was still plenty of space. But some interesting temporary entries showed up:

$ df -h

overlay 233G 199G 22G 91%
overlay 233G 199G 22G 91%
overlay 233G 199G 22G 91%
overlay 233G 199G 22G 91%
overlay 233G 199G 22G 91%
overlay 233G 199G 22G 91%
overlay 233G 199G 22G 91%

Not sure what these meant I've went to the next logical step: Google it!

Actually, duckduckgo to the help! Some quick research showed: The issue seems to vary in the version noted in the URL as well as in the endpoint/path:

error during connect: Post http://docker:2375/v1.39/auth: dial tcp: lookup docker on x.x.x.x:53: no such host

or for info:

ERROR: error during connect: Get http://docker:2375/v1.40/info: dial tcp: lookup docker on no such host

Possible Solutions #

Ben Gift added an alias to the docker-compose.yml:

- name: your_docker_image_location/docker:dind
alias: docker

Tucke shared in the same bug report another solution. He seemed to have solved it by editing the config.toml and adding "/var/run/docker.sock:/var/run/docker.sock" to the cache volume:

volumes = ["/cache", "/var/run/docker.sock:/var/run/docker.sock"]

Patrice added privileged on top in this issue:

privileged = true
volumes = ["/cache","/var/run/docker.sock:/var/run/docker.sock"]

A deleted GitHub user had to open a port?

Open Port 2375

Maybe, but this is rather unlikely for me as similar commands worked on my elementary/Debian machine.

In the end, none of these solutions solved my issue. A coffee break later, my solution arrived: I restarted my laptop and the issue was resolved afterward.


Since you've made it this far, sharing this article on your favorite social media network would be highly appreciated 💖! For feedback, please ping me on Twitter.