mitchellh/vagrant — pull request #2653 by acharlieh (2013-12-15 19:58:45+00:00)
Title: Enterprise Linux short hostname set to qualified hostname

It seems that on Enterprise Linux instances, with a qualified name set as the `config.vm.hostname`, the short name (from `hostname`) is set to the same value as the full name (as you get with `hostname -f`).

Using this [Vagrantfile](https://gist.github.com/acharlieh/7950826), you will see that the *_fqdn vms exhibit this property (i.e. `centos510.example.com` and `centos65.example.com`)

If you provision a RHEL or CentOS box from EC2, `hostname` will return the short name, and `hostname -f` will return the fully qualified hostname. (e.g. `ip-172-31-15-147` and `ip-172-31-15-147.us-west-2.compute.internal` respectively)

Looking in the code, it seems that we might be able to tweak the `plugins/guests/redhat/cap/change_host_name.rb` file, to check the results of `hostname -f` and pass the short name (first segment only) to `hostname` when setting and that seems to resolve things. (

Vagrant 1.4.1.dev at d321b9199e928bc42054c1b63beedf61e63686a0
VirtualBox 4.3.4