Hello everyone,
I've set up Pi-hole on a VPS in the cloud. It runs Pi-hole, acting as a recursive DNS server with unbound
, and also functions as a WireGuard VPN server. I followed the instructions provided in this video . I made a few changes to the VPN client configuration files so that only traffic for internal resources, such as DNS queries, is routed through the VPN, while the rest of the traffic bypasses the VPN. Specifically, I modified the AllowedIPs
line, changing 0.0.0.0/0
to the VPN network address (e.g., 172.16.16.0/24
).
Currently, I have a Nextcloud server running on an Orange PI at home. I access it only locally, but I would like to access it from outside my home network as well. Therefore, I connected the Nextcloud server to my Pi-hole VPN. This way, I don't need to open a port on my modem to access Nextcloud over the internet; I can simply use the VPN connection.
My devices are connected to the VPN 100% of the time, whether at home, on mobile data, on my company's Wi-Fi, or at my university. This allows me to access the Nextcloud server when I am away from home using its VPN IP (172.16.16.100
). The problem is that when I am at home and access the Nextcloud server with this IP, the traffic is unnecessarily routed through the VPN. I could access the server using its local IP (192.168.1.100
), but it is not practical to constantly switch this IP in the Nextcloud client app.
I would like to know if it is possible to create a domain name, for example, mynextcloudserver.local
, so that when I am at home, this domain resolves to 192.168.1.100
, and when I am away from home, it resolves to 172.16.16.100
. I am looking for a solution that works primarily on my Android devices, which connect to various networks throughout the day, and also on my Linux desktop, which stays at home.
Thank you in advance for your help!