Cheap IP Whitelisting for 5 Users
retained text
I was thinking about a way to limit the exposure of my selfhosted services. VPNs are cool but my phone heats up pretty fast and my battery is drained in no time. Then I thought hmm why not use DynDNS but reversed, I update the entry and whitelist this DNS entry.
If it is a shared IP like on mobile networks (celullar), it still allows other people using the same IP to connect to your services. That is why I would recommend only to expose things that require authentication. This will not fix your broken security, it will just reduce the amount of people that can attack your services.
* Setup DuckDNS (the only one I tested), hence the limit of 5 users
* Use Macrodroid or what ever you like to automate tasks on your phone, use normal taskscheduler on Windows or cron on Linux
* Setup a task, that does a webrequest to the DuckDNS update URL. As a trigger set it to update when you change to cellular. You could update it regularly or in Wifi, but make sure you are aware that by doing that all public IPs of any Wifi you connect to are temporarily allowed to connect to your services. That includes everyone on the same Wifi.
* In traefik I used the ddns-allowlist plugin.
http:
middlewares:
dynamic-client-allowlist:
plugin:
ddns-allowlist:
sourceRangeHosts:
- "ramaltman.duckdns.org" # Dynamic client address
sourceRangeIps:
- "192.168.1.0/24" # Optional: trusted home LAN
lookupInterval: 60
Now you have dynamic IPs that are allowed to connect to your services, of course you should still only expose services with authentication and use VPN for the rest. But for me this is an easy and low maintenance way to expose my services to fewer bad actors. And if you use Mikrotik you can use DynDNS addresses directly in your address-lists and further limit D-NAT exposure.document fetched 2026-11-10 00:28 · canonical https://reddit.com/r/selfhosted/comments/1xrp19t/cheap_ip_whitelisting_for_5_users