For the given example
Fiddling with /etc/hosts, /etc/hostname, /etc/network/interfaces and so on is fine for a few machines. If you have lots of (virtual) machines, try dhcpd.
Fiddling with /etc/hosts, /etc/hostname, /etc/network/interfaces and so on is fine for a few machines. If you have lots of (virtual) machines, try dhcpd.