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 working with a fresh Debian Squeeze install from Linode, and it looks like hostname behaves differently (from lenny) in a way that makes certain other packages unhappy. Viz:

clements@debian:/tmp/npm$ hostname -A
li228-113.members.linode.com 
clements@debian:/tmp/npm$ hostname -f
hostname: Name or service not known
clements@debian:/tmp/npm$ 

This behavior differs from an older (lenny) installation, where hostname -f does not signal an error. Reading the man page suggests to me that squeeze isn't a big fan of the -f option since machines can have multiple fqdns. That's fine with me, but packages like make-ssl-cert get crabby about it:

Setting up ssl-cert (1.0.28) ...
hostname: Name or service not known
make-ssl-cert: Could not get FQDN, using "debian".
make-ssl-cert: You may want to fix your /etc/hosts and/or DNS setup and run
make-ssl-cert: make-ssl-cert generate-default-snakeoil --force-overwrite
make-ssl-cert: again.

I'm hesitant to edit /etc/hosts; this wasn't required on my lenny VPS, and I have the feeling that it shouldn't be required here either.

Any suggestions greatly appreciated.

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

If you use FQDNFQDN (Fully Qualified Domain Name), then FQDN should be before short name in /etc/hosts. Correct

127.0.1.1       ubuntu-1010-server-01.local ubuntu-1010-server-01

wrong;

127.0.1.1       ubuntu-1010-server-01 ubuntu-1010-server-01.local

or run:

sudo make-ssl-cert generate-default-snakeoil --force-overwrite
share|improve this answer
    
can you shed some light on the change from lenny to squeeze? Why was this not required in lenny? Specifically, my lenny /etc/hosts has only the localhost line, and everything works fine. –  John Clements Feb 26 '11 at 19:16
    
attach /etc/hosts to question. If you use FQDN, then FQDN should be before short name. –  ooshro Feb 26 '11 at 19:19
    
I still feel like there's many things I don't understand going on here--other packages that provide this functionality--but adding the line you suggest certainly had the desired effect. Many thanks. –  John Clements Mar 15 '11 at 19:18
    
ran into this - needed to add fqdn, and aws's funky hostname to the hosts to resolve. –  tsykoduk Sep 9 '11 at 17:30
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.