Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

and yes, I have   localhost localhost.localdomain   myhost

in hosts file. What is wrong? Sendmail started to put this error into log.

May 9 19:08:54 myhost sm-mta[17103]: unable to qualify my own domain name (myhost) -- using short name

Is this configuration OK?

share|improve this question

closed as not a real question by Ward, Scott Pack, Jenny D, Tom O'Connor, gWaldo May 15 '13 at 13:08

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

What is "this error"? – cuonglm May 9 '13 at 17:29
unable to qualify my own domain name (myhost) — using short name – user107788 May 9 '13 at 17:32
I didn't receive this error at the beginning - It must be that I deleted something from somewhere – user107788 May 9 '13 at 17:33
@Gnouc however sendmail works almost entirely OK – user107788 May 9 '13 at 17:34
This question and its answer were exactly what I was looking for, so it should be reopened. The title states the question correctly. The body text asks whether the answer lies in modifying /etc/hosts, and if so, how. The answer makes it clear that this is indeed the case. The body text could be cleared up a little. – reinierpost Oct 7 '15 at 11:00
up vote 13 down vote accepted

Sendmail: short host name to FQDN via /etc/hosts entry

Reorder your /etc/hosts file entries:   localhost localhost.localdomain myhost

It should qualify myhost to (the leftmost name in /etc/hosts line with myhost)

share|improve this answer
what about localhost? might be after this? why? what are the rules? – user107788 May 9 '13 at 18:19
@Andzrej A.Filip really this way? I have seen many configuration but not this one, can you say anything about it? – user107788 May 9 '13 at 18:31
this works! great. However I had changed localhost localhost.localdomain to localhost before because my SMTP has introduced himself as localhost.localdomain : I am afraid this problem will come back now. What do you think about it? – user107788 May 9 '13 at 18:38
If you want to change how your SMTP server announces itself change the $j macro as described here – adamo May 9 '13 at 18:42
As I understand when sendmail uses /etc/hosts file to get Fully Quallified Domain Name (FQDN) it gets leftmost name from line with the short host name. – Andrzej A. Filip May 9 '13 at 18:44

What is wrong?

change it to be:   localhost localhost.localdomain myhost

the first from the left i line with hostname o staken to EHLO)

share|improve this answer
This appears to be the exact same thing as posted in the accepted answer, only it's worse and came later. – HopelessN00b Mar 15 at 3:26
@HopelessN00b: Downvote it and/or vote to delete it, but please stop flagging this stuff. This does not need mod attention and can be handled by the community. – Sven Mar 15 at 9:51