I can create a network between my ubuntu 14.04 and another machine by connecting ethernet cable between my ubuntu machine and second machine, and then setting "IPv4" to "share to other computers". The network created has IP that's something like 10.42.0.x. I'm doing this not to share internet, but to create a network between two machines, and this works very well.
For the two machines to address each other using hostname, I'd edit their /etc/hosts with respective IPs. I'd like this to be simpler, using MAC to IP mapping that's found in modern routers. What would be the easiest way to accomplish this?