the /etc/hosts is the right place for that.
Is it in format like:
22.214.171.124 yourcomputer.yourdomain yourcomputer morenamesForYourComuter
126.96.36.199 othercomputer.yourdomain othercomputer othernamesForOtherComputer
(with your own ip addresses)
Also be aware that hosts file configuration has to be in the host where you are trying to
connect from. So in practice you have to maintain hosts -lists for every computer in every
computer (alternative for this is to setup a domain name server).