[chef] Re: Re: fqdn and hostname


Chronological Thread 
  • From: Jesse Campbell < >
  • To: chef < >
  • Subject: [chef] Re: Re: fqdn and hostname
  • Date: Thu, 24 Jan 2013 14:17:50 -0500

on centos, chef returns the same hostname and fqdn as the responses from the hostname and hostname -f commands


On Thu, Jan 24, 2013 at 1:47 PM, Lamont Granquist < " target="_blank"> > wrote:
On 1/24/13 9:40 AM, " target="_blank"> wrote:
On an Ubuntu box, let's say the hostname is machine1.example.com.

In /etc/hosts, the first line is

1.2.3.4   machine1   machine1.example.com

What will chef consider the fqdn and hostname?    Apparently just "machine1".

Now that I have discovered this strange quirk, I wonder if I should use this on
purpose, to make the machine names smaller.     Or, be careful to avoid this
loophole.    I am just thinking out loud.    Do people generally use the whole
fqdn...

when you're doing a reverse lookup on 1.2.3.4 with that config you're getting back the first name which is the short hostname.  to get the FQDN just reverse that to:

1.2.3.4 machine1.example.com machine1






Archive powered by MHonArc 2.6.16.

§