Why not so this by default? For internal network have a DNS rewrite with local ip and only for external clients should use a public DNS record?
Self-Hosted Main
A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.
For Example
- Service: Dropbox - Alternative: Nextcloud
- Service: Google Reader - Alternative: Tiny Tiny RSS
- Service: Blogger - Alternative: WordPress
We welcome posts that include suggestions for good self-hosted alternatives to popular online services, how they are better, or how they give back control of your data. Also include hints and tips for less technical readers.
Useful Lists
- Awesome-Selfhosted List of Software
- Awesome-Sysadmin List of Software
I want this to be the default behaviour! :D
I have adguard installed in docker as DNS blocker. Can you please elaborate how I would set this up?
It´s easy in AdGuard:
- Go to Filter -> DNS Rewrites
- Add a new DNS-Rewrite
- Domain: dsm.example.com
- IP: 192.168.1.200
Now every client in LAN or Wifi connects directly to 192.18.1.200 while opening dsm.example.com. Outside the local network they will connected to the public IP.
Thank you so much, this is exactly what I was looking for!
Also credits to u/Accomplished-Moose50 and u/GolemancerVekk <3
What's your DNS resolver for your internal network? Use it to tie that domain name to the private IP you want. The devices that use your internal DNS will always go there – unless they use DNS over HTTPS, like they shipped for default in Firefox recently, in which case you'd have to either disable DoH in Firefox or make an exception for that domain.
If you use DHCP it may also do DNS (like dnsmasq does) so you may be able to distribute the override to DHCP-using devices while still using an exernal DNS for everything else.
I have Adguard running and setup as primary DNS in the modem. So u/Accomplished-Moose50 just named Adguard already as an option to do "magic" there.
Aaaah, I think I get it. So in Adguard there is just the rule to always forward any request to example.com to 192.168.1.200 because that is always true.
Yes that would work! Just have to find out how ^^, I'll dive into the documentation of adguard.