Reputation: 6451
I connect to local servers on the same network as "staging.local" (where staging is the hostname on the local server).
Is it possible to do the name in os x hosts file like this:
staging.local mydomain.com
That doesn't seem to work. Referencing the ip address directly does work but it can change often (192.168.0.196 mydomain.com).
Any help would be greatly appreciated.
Upvotes: 0
Views: 1592
Reputation: 4778
No, this cannot be done with unix hosts files.
This can be done with DNS/bind using CNAME, but the hosts file is basically like using A/PTR -- No aliases allowed.
You can create aliases for using by ssh if this is what you will be using them for in ~/.ssh/config
Host staging.local
HostName mydomain.com
Upvotes: 2