DNS setting on other interfaces


Recommended Posts

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

 

 

 

 

Link to comment

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 by danioj
Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.