Can I set up a hostname alias that is only active in a specific network?

Posted by denisw on Ask Ubuntu See other posts from Ask Ubuntu or by denisw
Published on 2012-12-08T22:02:41Z Indexed on 2012/12/08 23:36 UTC
Read the original article Hit count: 176

Filed under:
|
|

I have a small ARM box running ownCloud in my house, and a domain bound to my DSL router with Dynamic DNS. This works well as I can configure the ownCloud client to use the domain name, which works both in the house and when I'm on the road.

However, at home I would like to let my laptop and my server talk to each other directly on the local network, rather than as if they were talking over the Internet (including DNS resolution for my domain name, routing all traffic through the DSL machinery etc.). I know that I can set a hostname alias for my domain in /etc/hosts - the problem is that I want this alias to only be active when I'm in the home network, while in all other cases DNS resolution should be used as normal. Is this possible?

© Ask Ubuntu or respective owner

Related posts about networking

Related posts about network-manager