February 7, 20242 yr I've configured custom bridge interfaces in my Docker settings that correspond to my local VLANs I want my Docker containers to live on. When installing a new container, selecting one these VLAN-specific custom bridge interfaces requires me to set a static IP for the container (using IPVlan). All the containers I've setup install just fine this way and have full network functionality on their designated VLANs as intended. The only thing I can't figure out is how to set the DNS server configuration for my Docker containers. I have a local AdGuard-Home instance running as a Docker container on this Unraid server I'd like to be the primary DNS server for all other Docker containers as well as everything else on my network. The only exception being the Unraid server itself, I set that to use 9.9.9.9 since it will be booting prior to the AdGuard Docker container. Since I set Unraid to use 9.9.9.9 as it's DNS, is it passing this through to Docker behind the scenes and then all installed Docker containers use 9.9.9.9 as a result? When I do a "cat /etc/resolv.conf" command through the terminal for one of my local containers (tested on the linuxserver build of Radarr in this example), it returns that the container is using 127.0.0.11 for it's DNS server. Where can I override this to use my AdGuard IP? I couldn't find anything under Docker settings and none of the additional parameters I tried passing to the container during setup honored the IP (I read you should be able to specify this using a parameter of "DNS" in the container setup, but it didn't work).
February 7, 20242 yr Author Ok, so making some progress on this, I read you should be able to override the DNS for a container by specifying "--dns X.X.X.X" as an extra parameter passing your DNS IP as part of the container setup, but couldn't see where to enter parameters. Turns out I just had to enable Advance View. Anyway, I tried entering "--dns X.X.X.X" to specify the IP of my DNS server in extra parameters field, but the container still shows 127.0.0.11 as the DNS server on boot. Am I doing that right? I did test this with a second container and saw the same behavior.
November 9, 20241 yr If you find your self at this post, you are in the same boat as "us" now default behavior is that the dockers DO use the normal way of sending DNS requests, a.k.a. to the gateway. And it should be possible to add an extra DNS server to your config. If that STILL does work... please check your firewall rules..... Via rules I manage to block traffic to the gateway, that is an efficient way to make you lost some hair.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.