Host is missing hostname and/or domain

344 views
Skip to first unread message

JonY

unread,
Feb 21, 2014, 11:50:20 AM2/21/14
to puppet...@googlegroups.com
I have 36 (seemingly) identical machines deployed from a single manifest. For some reason I'm getting this error in my logs for a subset of them. 

/etc/hosts:

127.0.0.1 hostname hostname.fqdn localhost


Where else should I look?

jcbollinger

unread,
Feb 24, 2014, 10:17:28 AM2/24/14
to puppet...@googlegroups.com


On Friday, February 21, 2014 10:50:20 AM UTC-6, JonY wrote:
I have 36 (seemingly) identical machines deployed from a single manifest.


Puppet does not do deployment, only post-deployment configuration.  I raise that here because I think it likely that the problem likely boils down to a deployment issue.

 
For some reason I'm getting this error in my logs for a subset of them. 

/etc/hosts:

127.0.0.1 hostname hostname.fqdn localhost



Maybe nowhere else.  That hosts entry is bogus on at least two grounds:
  1. You should not be pointing the host's primary name at a loopback address.  If you list it in /etc/hosts at all, it should be pointed at the IP address assigned to the host's primary network interface.
  2. The canonical name field of each entry (the second) should hold the fqdn.  The unqualifed name, if listed, should be among the aliases (subsequent fields).
Example:

192.168.0.42 host.mydomain.com host
127.0.0.1    localhost.localdomain localhost

Traditionally, the host's own name needed to be first in /etc/hosts, as that was how machines determined their own names.  That might still be the case for some UNIX flavors, but I don't think it's common any longer.  It doesn't work well for machines with dynamic IPs, so many systems use an alternative means to record a machine's hostname.  On RedHat-family Linuxes, at least, that's the 'HOSTNAME' entry in file /etc/sysconfig/network.  Machines that employ such a mechanism do not normally require a machine's own hostname to be listed in /etc/hosts at all.

It may be illuminating to run the 'dnsdomainname' command on one of the affected machines.  If it does not give the correct fully-qualified name for the machine, then the machine is configured wrongly.  Such an error is an initial provisioning / deployment problem.  You should assign the machine its name before first firing up the Puppet agent on it.


John

JonY

unread,
Feb 24, 2014, 12:05:23 PM2/24/14
to puppet...@googlegroups.com
I think I found the problem. On the systems that have this error the /etc/resolv.conf file is missing the 'domain <name.org>' line. It's getting wiped out / replaced by DHCP at boot time. 

If I add the appropriate line back in the error goes away. I'll add a template file to puppet to maintain this add see what happens.
Reply all
Reply to author
Forward
0 new messages