# Hostname + domain name and without hostname in rc.conf



## Buck (Nov 28, 2021)

What are the general recommendations for a public-facing mail server regarding hostname? I've been living forever with *mybox.domain.com*, recently changed it to just *domain.com* and it broke Postfix delivery. While I'm sure I can work around that particular issue, I wonder what I can and should use in rc.conf for hostname, if my mails are delivered from *address@domain.com*, is there a point in having *mybox* there?
This is obviously tied to the PTR record which I'm also not sure about. I'm hosting multiple domains, they all have the same MX record, should it be mybox.domain.com or domain.com? I don't think it should matter if my PTR resolves to mybox.domain.com while MX is set to domain.com?
I'd probably keep mybox.domain.com in rc.conf but my SSL certificate only covers www.domain.com and domain.com, I have set those certs in *smtpd_tls_chain_files* in Postfix's main.cf, but not sure if those were even necessary for proper TLS delivery.

So TLDR: confusion between what should be put in hostname, MX and PTR.


----------



## Alain De Vos (Nov 28, 2021)

Multiple configurations are possible depending.
A possibility:
rc.conf hostname/fqdn: ahost.adomain.com
mx record : ahost.adomain.com
email address me@ahost.adomain.com
ptr : 89.67.45.123.in-addr.arpa.
a: 123.45.67.89

Another:
rc.conf hostname/fqdn: adomain.com
mx record : adomain.com
cname: ahost.adomain.com->adomain.com
email address me@adomain.com
ptr : 89.67.45.123.in-addr.arpa.
a: 123.45.67.89


----------

