Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm running ec2 debian instance and trying to get puppet working on it. I'd like my hostnames to be something more readable, so I've changed /etc/hostname, run /etc/init.d/hostname.sh start and I can see my human-readable hostname in the prompt. Every other app seems to be working fine with it, but not puppet (and actually it seems it's facter problem):

$ cat /etc/hostname 
service.XXX.com
$ hostname
service.XXX.com
$ facter | egrep '(host|domain)'
domain => compute-1.amazonaws.com
hostname => ec2-107-22-XXX-XXX
$ cat /etc/debian_version 
6.0.1

I've already cheched facter code and it seems it does not anything more than parsing hostname output. Where is this thing come from? I want my hostnames!

share|improve this question
    
Had the same hostname issue and adding it as first alias in hosts fixed the problem for me too. Debian Squeeze. –  user113065 Mar 6 '12 at 11:07
add comment

1 Answer

up vote 0 down vote accepted

Blah, it seems it parses /etc/hosts and my beautiful hostname should be the first alias for '127.0.0.1' (127.0.0.1 service.XXX.com localhost localhost.localdomain ...). Anyone knows, is this expected behavior?

I'm still not sure where ec2-blah-blah-blah comes from, but it seems the issue is resolved.

share|improve this answer
    
Puppet tries to get the reverse to the IP address -- I'm surprised 127.0.0.1 did it for you. It also looks up /etc/resolv.conf for the domain. Have you tried just grepping ec2-... on /etc to see what configuration contains that? –  Daniel C. Sobral Nov 16 '11 at 11:54
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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