With puppet installed, the command /opt/puppet/sbin/refresh-mcollective-metadata is run every 15 minutes. It loggs hostname: Host name lookup failure when it runs.

hostname, hostname -i, and hostname -f all return hostname: Host name lookup failure


This can occur because the hostname is not set in CentOS.

Run the command hostname machine.example.com to set the hostname on the machine then MCollective and all the above-mentioned hostname commands will return the correct values.

Note: it's probably worth looking at the comments on this solution.

  • 3
    Setting the hostname to an FQDN is quite a crude workaround. Generally it should be an unqualified name like machine in your case. Set the FQDN using /etc/hosts - it should be the first entry on the first line that contains the unqualified name as an alias, e.g. machine.example.com machine localhost – Felix Frank Jun 28 '14 at 22:34
  • 1
    @FelixFrank thanks for the comment. I did some research based on what you said and found these two relevant resources: jblevins.org/log/hostname serverfault.com/questions/331936/… – Dan Bowling Jul 11 '14 at 19:10
  • // , Is the hostname command the "canonical" or usual way to set a machine's host name in Linux? – Nathan Basanese Jan 15 '16 at 23:20
  • // , Like Jasmine Longes commented on serverfault.com/a/331942/282446, shouldn't /etc/sysconfig/network contain lines like: NETWORKING=yes, NETWORKING_IPV6=no, HOSTNAME=example.com, NISDOMAIN=example ? – Nathan Basanese Jan 15 '16 at 23:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.