Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

(SOLVED) Guidance on Docker networks and local DNS

Featured Replies

  • Community Expert

Hi Team,

Looking to get some guidance or advise on my setup,

TLDR : Looking to see how I can route my DNS to a Nginx Rev Proxy while its running on a docker network

The Setup,

Following a number of guides (The Ultimate Guide to SWAG on Unraid: Beginner to Advanced - Uncast Show to Installing and Configuring NGINX Proxy Manager on Unraid and a lot more which have a similar concept) the end goal is setup a docker network 'proxy' and have selected containers running within it by name or call out the specific IP for containers outside of the docker network.

The Goal

Using my Pihole setup I'm looking to have local DNS reference the SWAG container directly so when I'm within the network it will route locally vs going out to Cloudflare then needing to route me back in to my local network. This will avoid me needing everything (even my internal only apps) to have records in CF to use the FQDN vs the IP

The Issue

All the guides seem to suggest and recommend having a docker network for the Nginx system to live in and any apps which are being thrown in should also live on that network for ease of use within the setup etc. When I try to route Cloudflare/Internet DNS traffic is works no issues as my router sees a 443 request and it converts it to the local xxxx port that Nginx is using (no problem here). The issue comes in when locally I try and do a similar process, using PiHole for example, it only allows like A and CNAME records are designed for, pointing at a specific host and not allowing ports to be changed etc. When I do this the Docker network (which is seen by the browser and the local LAN is actually the raw IP of the Unraid server (so any attempt to access [docker].<my-Domain-name>.com will hit the 443 port on the unraid server NOT the Nginx port (which is mapped from the public from 443->xxxx as mapped in the docker template, as per most of the above videos) doing this mapping locally when I try to access the FQDN I land at the unraid dash login which is listening on 443 as the main server.

Attempted fix's

Solution - Externally map to the container IP and allow the F/W to re-map and for any local traffic route to an IPv4 address attached to the same SWAG docker.

Solution Issues - When I map either the proxy or the vlan to the Docker ( Using "&& docker network connect <name of vlan OR name of docker network> swag" along with even setting the gw_priority but no matter which network was loaded into the template or added it still failed and preferred the vlan) all the other functions seem to break and my WAN routing causes anything which was working to then stop. This is even when the listening port is setup for just the port or even <docker ip>:443 for example. I'm not sure if swag just isnt built to work with two interfaces correctly or if there is another section of the config I need to change to let the system use both as it seems to always fall back to the vlan as all of my prior working seem to break when adding the network settings above.

So I'm hoping someone may have a workaround for this, or know why adding the extra network to the Docker seems to break things (I recall reading that networks are added in a specific priority and not sure how I can change it within the template that one network is taken above another for preference)

Or should I just forget everything about the videos about building this 'proxy' network and just move it to a separate vlan and call it a day?

I have seem issues posted over previous platforms and the fix seems to be just change the default unraid ports and let it flow, but I'm hoping there may be another way to make this work when trying to use the Rev proxy on the same box where the Pihole is without breaking the other way things work.Need some help with Pi-hole local DNS and Nginx Proxy Manager : r/unRAID

Just to clear up some possible questions,

Everything works fine using Cloudflare, port forwarding etc both internal and external when the system is mapped to the 'proxy' network, once I add another network everything stops working and I get an error trying to load the apps

Both networks show when I inspect the docker container and are issued IP's

The app can ping containers in the proxy and vlan with no issues (by Name for proxy based and by IP for the vlan base)

Using Unraid 7.2.0

SWAG 5.6.0 by Linux Server

Hope someone can see my issue or point me to some guidance,

Edited by brent3000

Solved by brent3000

  • Author
  • Community Expert
  • Solution

For reference if anyone needs it,

[BUG] Adding additional network interfaces causes access issues · Issue #610 · linuxserver/docker-swag

Issue fell back on the Docker network motions, when using a vlan docker doesn't respect any port mapping requests and will default to this IP due to how Docker handled networks.

This is why the ports failed to work on the Docker network along with why the system preferred the vlan it was allocated.

Final workaround was mapping all ports from the 1443 to the 443 the container used by default as the VLan it was allocated does not use the port redirects.

  • brent3000 changed the title to (SOLVED) Guidance on Docker networks and local DNS

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...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.