danioj Posted August 14, 2020 Share Posted August 14, 2020 Hello, The unRAID interface does not allow for specifying DNS settings. One would assume this is by design (or by restriction) as this seems something quite obvious to omit. I have set my secondary NIC up against a port on my switch which is assigned to a VLAN which pfsense routes through my VPN gateway. I have the interface to grab an IP from my VLAN DHCP server (which it does) but Id like to just set the VPN DNS Server directly rather than the way I have unraid setup (unraid>Pihole>pfsense(unbound)). I have bridging enabled on that interface, which I then use to assign an IP to a docker container. This works great, and traffic is routed as I expect through my VPN via the VLAN. That is until I need name resolution. My question is, how do I achieve what I want (which is being able to set a set of different DNS servers for the secondary interface) assuming that, as I say above, this is by design or restriction? I am creating a new topic as there have been a number of similar topics created in the past but have had no answers. I cannot find a topic through the forum search that answers this question. Any info on this would be helpful. Thanks Daniel Quote Link to comment
danioj Posted August 14, 2020 Author Share Posted August 14, 2020 (edited) Best way to answer a question you have is to sometimes write it down. This has worked in my case in that I re-read what I wrote and thought - that sounds strange. RTFM!! So I went and read the Docker documentation. In 2 mins I found what I needed. https://docs.docker.com/config/containers/container-networking/ Key part being: Quote DNS services By default, a container inherits the DNS settings of the host, as defined in the /etc/resolv.conf configuration file. Containers that use the default bridge network get a copy of this file, whereas containers that use a custom network use Docker’s embedded DNS server, which forwards external DNS lookups to the DNS servers configured on the host. Custom hosts defined in /etc/hosts are not inherited. To pass additional hosts into your container, refer to add entries to container hosts file in the docker run reference documentation. You can override these settings on a per-container basis. settings on a per-container basis. This makes it (sort of) clear why the option doesn't exist in unRAID. Either way, I was able to add --dns X.X.X.X to the docker run command via the advanced mode in the container setup page and low and behold, external DNS was set in the container. Edited August 14, 2020 by danioj Quote Link to comment
Frank1940 Posted August 14, 2020 Share Posted August 14, 2020 Please edit your first post to this Thread and mark the topic as [SOLVED]. Quote Link to comment
Recommended Posts
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.