How to fix "unable to qualify my own domain name (myhost) -- using short name"?

65,434

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

Reorder your /etc/hosts file entries:

127.0.0.1   localhost localhost.localdomain
127.0.1.1   myhost.mydomain.eu myhost.domain2.eu myhost

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

Share:
65,434

Related videos on Youtube

AnFi
Author by

AnFi

Updated on September 18, 2022

Comments

  • AnFi
    AnFi over 1 year

    and yes, I have

    127.0.0.1   localhost myhost.mydomain.eu myhost.domain2.eu localhost.localdomain
    127.0.1.1   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?

    • cuonglm
      cuonglm about 11 years
      What is "this error"?
    • Admin
      Admin about 11 years
      unable to qualify my own domain name (myhost) — using short name
    • Admin
      Admin about 11 years
      I didn't receive this error at the beginning - It must be that I deleted something from somewhere
    • Admin
      Admin about 11 years
      @Gnouc however sendmail works almost entirely OK
    • Admin
      Admin about 11 years
      this is error from mail.err
    • cuonglm
      cuonglm about 11 years
      Would you mind posting the error and your sendmail config?
    • Admin
      Admin about 11 years
      @Gnouc this is this error, I added to question. (possibly I've just found solution)
    • reinierpost
      reinierpost over 8 years
      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.
    • PJ Brunet
      PJ Brunet over 7 years
      In CentOS 6, this error can be found in /var/log/maillog and the solution (which could be explained better) makes a big difference. I've been working on Dovecot+Postfix+Sendmail for 2 days now and thanks to this crazy question, this is the first time I'm able to email my own server. Goodbye Gmail ;-)
  • Admin
    Admin about 11 years
    what about localhost? might be after this? why? what are the rules?
  • Admin
    Admin about 11 years
    @Andzrej A.Filip really this way? I have seen many configuration but not this one, can you say anything about it?
  • Admin
    Admin about 11 years
    this works! great. However I had changed 127.0.0.1 localhost localhost.localdomain to 127.0.0.1 localhost myhost.mydomain.eu 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?
  • adamo
    adamo about 11 years
    If you want to change how your SMTP server announces itself change the $j macro as described here
  • AnFi
    AnFi about 11 years
    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.
  • Admin
    Admin about 11 years
    I have tested and it looks like indeed myhost.mydomain.eu is taken to introducing themself by my sendmail (I didn't change $j macr but thanks adamo), previously I was listed on Spamhaus due to my SMTP EHLOong as localhost.localdomain. THANK YOU
  • AnFi
    AnFi about 11 years
    IMHO changing $j (solution for sendmail ONLY) should not be be first choice in most situations.