With my laptop, when accessing a given domain on the local network, I need to use a local IP address (192.168.x.x).
When accessing the same domain from a remote location, I need to use the public IP address. Since I am accessing the domain via DNS, which always returns the public IP address, how can I make things work using the same domain name regardless of whether I am on the local network or not, without tweaking my hosts file whenever I change locations(which is what I currently do to fix this situation).