I have a server at home, with internal IP
192.168.1.100. I use a dynamic DNS service so that I can reach it at
http://foo.dynu.com when I am out. When I have my laptop at home, I know that I could directly connect to the server by adding the following line to
However, is there a way to automatically apply this redirect only when I'm on my home network? (I usually connect via a particular wifi connection, although I occasionally connect via ethernet. If this complicates matters, then I'm happy to only set it for the wifi connection.) I use Network Manager.
Also, I connect to the internet via a VPN, so presumably any configuration on my (OpenWRT) router is unlikely to work.