Pass DNS to containers with Traefik?

Hey,

I have a Pi-hole container in host mode that I use as DNS to point to domain only accessible on my LAN. So, It gives 192.168.1.175 when domain.local is asked. I have a container in a docker private network in bridge mode.

I would like to know if Traefik can pass DNS to this container?

The problem is the container inside doesn't know (I guess) 192.168.1.175 because it is on a, let's say, 172.1.2.0/18 (internal to Docker) network.

Can Traefik give the DNS info, or not at all?

Thanks.

Standard Traefik doesn't handle DNS, but the underlying container or operating system is.

The client uses DNS to resolve a URL, then connects to the IP. If Traefik is running on the IP and port, it will then forward http requests according to Host() and/or PathPrefix().

Thanks for your reply, but I'm not sure that's exactly what I'm asking.
Traefik works, that's not a problem, I can reach my container with a subdomain on my domain.

But, for example, homepage (a dashboard), needs to resolve plex.domain.local to communicate with its API, but inside the homepage container, it can't because: homepage is not on the same Docker network thus, doesn't know 192.168.1.175 which is my internal DNS.

So, I wanted to know if traefik can handles that or if I should take a look on Docker side.

DNS name resolution is not a Traefik thing, its underlying. So it's Docker or OS.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.