traefik-library-image icon indicating copy to clipboard operation
traefik-library-image copied to clipboard

fix(dns): /etc/hosts was ignored by traefik

Open kopax opened this issue 5 years ago • 9 comments

Fix https://github.com/containous/traefik/issues/6001

What does this PR do?

It create the missing /etc/nsswitch.conf.

Motivation

During proxying, traefik is performing a DNS resolution. This DNS resolution is skipping /etc/hosts file. This can cause unwanted DNS resolution, especially when using hostname as fqdn in marathon.

If you use /etc/hosts file for some resolution, this will fix it. If you use a real fqdn in marathon on a private network, you will still have to properly configure DNS serveur in traefik host.

kopax avatar Dec 12 '19 12:12 kopax

Related to #42

ldez avatar Dec 12 '19 13:12 ldez

I am curious, if this was already merged, why was it removed?

kopax avatar Dec 12 '19 13:12 kopax

No clue why travis get this:

 ---> Running in d7c16a0f1158
OCI runtime create failed: container_linux.go:348: starting container process caused "exec: \"/bin/sh\": stat /bin/sh: no such file or directory": unknown
The command "./.ci/test.sh" exited with 1.

kopax avatar Dec 12 '19 15:12 kopax

What command are required in the alpine image ? It seems they already have /etc/resolv.conf since you import them from another image.

kopax avatar Dec 12 '19 20:12 kopax

Thanks for providing all the details, I've updated the PR with requested change.

kopax avatar Dec 14 '19 12:12 kopax

Side question: what is the status of this feature request for the Windows Docker images?

dduportal avatar Dec 22 '19 12:12 dduportal

Hi @kopax , can you ensure that you're setting the parent image to 2.1.1-alpine please? You can check the Travis-CI build logs, or run the command by yourself to reproduce the error on your local change.

dduportal avatar Jan 01 '20 15:01 dduportal

Hi @dduportal too much time have passed since the https://github.com/containous/traefik/pull/6012 and I lost track of what is needed. What about the alpine image? Was this never fixed in recent traefik version? I am still running on 2.1.1 with this fix but perhaps it's time to close this?

kopax avatar Sep 13 '20 13:09 kopax

Hi @kopax , I am not involved anymore in the Traefik project. I would delegate to @ldez and @SantoDE to take care of your request instead :)

dduportal avatar Nov 03 '20 12:11 dduportal