[Openstack] Question about hostname.

Lei Zhang zhang.lei.fly at gmail.com
Tue Dec 4 03:34:58 UTC 2012

Hi all,

I change the machine hostname by using follow commands

$ hostname puppet-master.domain.com
$ sed -i 's/HOSTNAME=.*/HOSTNAME=puppet-master.domain.com/'

But when checking it. I got following output

$ hostnamepuppet-master.domain.com
$ hostname --long

$ hostname -A

If I add the ip-domain mapping to the /etc/hosts file, it became right.

$ echo " puppet-master.domain.com puppet-master" >> /etc/hosts
$ hostnamepuppet-master.domain.com
$ hostname --longpuppet-master.domain.com

$ hostname -Apuppet-master.domain.com

I want to know why the hosts contents affect the hostname command
Lei Zhang

Blog: http://jeffrey4l.github.com
twitter/weibo: @jeffrey4l
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20121204/86b83e76/attachment.html>

More information about the Openstack mailing list