1 Domain, 3 Places to Route, 3 Redundant DNS (PiHole) reddit / selfhosted ---------------------------------------------------------------------- trancekat · 2023-12-10 17:12 Hi All. I have a question on how I can route traffic within my environment as well as out to the internet based on port #. I have 2 local servers running docker with a variety of services on each. Plans for a 3rd server that will run in Oracle Cloud as a VPS in the future to provide whoogle service and vpn (planning for this, but it's not there today). Server-A [192.16.0.20] (Tdarr, Jellyfin, Frigate, dns1) Server-B [192.16.0.24] (Fidi, Frigate, Monica, Portainer, dns2) Server-C [Future State] (Whoogle, Wireguard Client/Server) I have a domain registered (domain.com) that I'd like to use for all my services. i.e. tdarr.domain.com, jellfin.domain.com, fidi.domain.com, monica.domain.com, whoogle.domain.com. I registered the domain because I want to use letsencrypt to get a certificate. I have 3 DNS in my local network: dns1 and dns2 are piholes running in docker on the servers listed above. dns3 is a phihole running on a RaspberryPi on the same network. What I'd like to do is be able to go to 192.168.0.20:8056 when I type jellyfin.domain.com, and to 192.168.0.24 when I enter monica.domain.com. What would I have to do to make this happen? Is the correct solution to have *.domain.com resolve to either server A or server B and then have nginx running on just that server that will then either route the fqdn to 192.168.0.20:port or to 192.168.0.24:port? Thank you for your time and help ---------------------------------------------------------------------- thekrautboy · 2023-12-10 17:44 > What I'd like to do is be able to go to 192.168.0.20:8056 when I type jellyfin.domain.com, and to 192.168.0.24:8964 when I enter monica.domain.com. Add the records to your DNS and use a reverse proxy to get SSL from Lets Encrypt and pointing at the correct ports. This is asked and answered almost daily here. Use the search to find plenty of info. > Is the correct solution to have *.domain.com resolve to either server A or server B at all 3 pihole DNS and then have nginx running on just that server that will then either route the fqdn to 192.168.0.20:port or to 192.168.0.24:port? If you want to use wildcard CNAME´s then you need to simply decide which of your servers has the most services that you will proxy to. Then point a * wildcard to that server and it covers everything on that one. Add seperate DNS records pointing to the IP of the other server(s). If you want to do this on your Piholes only that works, but it should be obvious that any outside clients cannot resolve these services then. If you use a public DNS for your domain, you can add these records there and they work inside and outside your network. ---------------------------------------------------------------------- trancekat · 2023-12-10 19:54 Great, thank you! Exactly what I thought I had to do. Appreciate the confirmation.