Hey all. I’m hosting a Docmost server for myself and some friends. Now, before everyone shouts “VPN!” at me, I specifically want help with this problem. Think of it as a learning experience.
The problem I have is that the Docmost server is accessible over internet and everyone can log on and use it, it’s working fine. But when I try to access over LAN, it won’t let me log in and I am 99% sure it’s related to SSL certs over LAN from what I’ve read.
Here’s the point I’ve gotten to with my own reading on this and I’m just stumped now:
I’ve got an UNRAID server hosted at 192.186.1.80
- on this server, there’s a number of services running in docker containers. One of these services is Nginx Proxy Manager and it handles all my reverse proxying. This is all working correctly.
I could not for the life of me get Docmost working as a docker container on UNRAID, so instead I spun up a VM and installed it on there. That’s hosted at 192.168.1.85
and NPM points to it when you try to access from docmost.example.com
- that’s all dandy.
Then, I installed Adguard Home in a docker container on my UNRAID server. I pointed my router at Adguard as a DNS server, and it seems to me that it’s working fine. Internet’s not broken and Adguard Home is reporting queries and blocks and all that good stuff. So that’s all still working as it should, as far as I’m aware.
So, in Adguard Home I make a DNS Rewrite entry. I tell it to point docmost.example.com
to 192.168.1.80
, where NPM should be listening for traffic and reverse proxy me to the Docmost server… at least I thought that’s what should happen, but actually nothing happens. I get a connection timed out error.
I’m still pretty new to a lot of this stuff and have tried to figure out a lot of things on my own, but at this point I feel stuck. Does anyone have advice or tips on how I can get this domain to resolve locally with certs?
I can provide more info if needed.
Cheers all!
Opisek@lemmy.world 4 days ago
Never point your DNS at a local IP address. That will only cause you pain and unexpected behaviour.
What you are experiencing is solved by so-called “NAT reflection” or “NAT loopback”. It’s a setting that in the best case you should just be able to activate on the appropriate interface in your gateway.
fishynoob@infosec.pub 4 days ago
I don’t think OP made two A records here. He simply configured the reverse proxy to point to the VM and the A record to point to the reverse proxy. In my mind, if NGINX is terminating SSL then the only problem could be ports.
Opisek@lemmy.world 4 days ago
Not two A records. From what I understand, OP has an A record pointing to their public IP address. Then, on the local network, OP uses their own DNS server to ignore that entry and instead always serve the local IP when a host on the LAN queries it.
Aside from OP’s devices potentially using a different DNS server (I was only able to solve it for my stock Android by dropping outgoing DNS in my firewall), this solution is a nightmare for roaming devices like mobile phones. Such a device might cache the DNS answer while on LAN or WAN respectively and then try to continue using that address when the device moves to the other network segment. That’s the second likely scenario in my opinion - OP’s devices are ignoring the hacky DNS rewrite and try to access the server via the public IP.
rumba@lemmy.zip 3 days ago
Hard disagree, I’d bifurcate my internal DNS in a hot second before I tried to fix this with static routes. Was internal services aren’t going anywhere in that DNS servers ain’t going anywhere The only time they can figure it should take effect is when it’s needed
Asking a noob to handle static routes is a double ungood situation.
Home gamer with a router that can handle reflection would be rare.
It’s one service that he’s hosting and in control of, and he’s also in control of that internal IP so it doesn’t have to change.
If anything I’d be worried that those VMs and applications in the VMs are getting regular updates. He’s more likely to get intruded through a zero day on one of those hacks than he is to see any serious issues through throwing a couple DNS records around.
sugar_in_your_tea@sh.itjust.works 4 days ago
Why?
I have a similar setup, but to add to the problem, I’m also behind CGNAT. Here’s my setup:
To access my LAN from outside, I have a WireGuard tunnel to my VPS.
The address my DNS resolves to is absolutely unrelated to any addresses my router understands. So to prevent traffic to my locally hosted resources from leaving my LAN, I need my DNS to resolve to local addresses. So I configured static DNS entries on my router to point to local addresses, and I have DHCP provide my router as the primary DNS source and something else as a backup.
This works really well, and TLS works as expected both on my LAN and from outside my LAN. The issue OP is seeing is probably with a non-configured device somewhere that’s not querying the local DNS server.
Opisek@lemmy.world 4 days ago
I explained why. Misconfiguration and caching.