4

In this blog post he suggests

echo '127.0.0.1    localhost EXAMPLE.my_domain localhost.localdomain EXAMPLE' >> /etc/hosts

but ends the post with

But this is a less desirable approach since it may have some side effects.

In this questions there isn't a definitive answer on the solution.

Question

What is the recommended way to give sendmail a FQDN?

Jasmine Lognnes
  • 2,490
  • 8
  • 31
  • 51

3 Answers3

8

For sendmail, I do two things:

  • Make sure my /etc/hosts file follows the standard documented here.
  • If I need to present a specific outgoing server name, I define confDOMAIN_NAME in sendmail.mc to reflect the right name:
define(`confDOMAIN_NAME', `mail.juicybanana.com')dnl
ewwhite
  • 194,921
  • 91
  • 434
  • 799
4

You say the mail server is going to be sending to the internet. That means it's going to connect to public mail servers, and the first thing it will do (as part of the SMTP HELO) is declare its own FQDN.

If you use a false or non-resolving FQDN here, a lot of mail servers are going to refuse to talk to you any further, or will use that as a strong indicator for spam even if they accept your email. You are strongly advised to register a domain name and declare a valid hostname under that, to use in the sendmail config. If you already have a domain name, you can declare a new subdomain, and a hostname under that for this server.

The only mail servers that can get away with nonexistent FQDNs are those which are purely internal, and even then it's often so painful that I advise people to use a valid FQDN.

MadHatter
  • 78,442
  • 20
  • 178
  • 229
2

The recommended way is to fill the /etc/hosts with records, one for each ip address of the host, with a configured hostname of this host (with the appropriate command), so sendmail won't need to query the DNS. "He", whoever this is, is wrong. He is showing you a perfect way to shoot your own leg.

drookie
  • 8,051
  • 1
  • 17
  • 27