Best way is to tell rabbitmq to not to look for hostname. You can do that using rabbitmq config file.
edit config, create it if it does not exist
vim /etc/rabbitmq/rabbitmq.conf vim /etc/rabbitmq/rabbitmq-env.conf (in later versions of RabbitMQ) Add following entries:
NODENAME=rabbit@localhost
NODE_IP_ADDRESS=127.0.0.1