If you look in beaker/host_prebuild_steps.rb there is a method called hack_etc_hosts that duplicates a lot of this.  As long as each box has an ip address it can handle the rest.