hostname -f says "hostname: the specified hostname is invalid". The hostname (FQDN) specified in /etc/hostname is also listed in /etc/hosts and is pingable. No actual DNS server yet of the host knows. Is this a reason of the error reported or something else? (the OS is Ubuntu 10.04 Server).

Update: registering the host at a DNS server (so that the name can be successfully resolved via Internet) did not help.

link|improve this question

38% accept rate
1  
Well... what's the contents of /etc/hostname or do we need to guess that too? – rodjek Jun 29 '10 at 5:06
Please share the contents of your /etc/hostname and /etc/hosts. Maybe the hostname is in fact invalid. – Dave Jun 30 '10 at 7:34
feedback

3 Answers

/etc/hostname should only contain the hostname and not a full FQDN.

link|improve this answer
Tried this. No difference. – Ivan Jun 30 '10 at 6:49
feedback

Check the configuration of:

/etc/host.conf
/etc/nsswitch.conf

host.conf should have "order hosts, bind" and nsswitch.conf should have "hosts: files dns" at a minimum. Possibly you've got something out of whack that's searching only DNS and not your local files?

link|improve this answer
clearly not the problem. – hop Jun 29 '10 at 21:51
Al that's there. – Ivan Jun 30 '10 at 6:50
solved the problem for me, Host \209\149something.sld.tld returned servfail - it looked ok though, osx terminal injecting funny things again ;) – ZaphodB Apr 8 '11 at 22:03
feedback

hostname -f relies on DNS working.

What does:

host `cat /etc/hostname`

print?

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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