-1

What should I set as hostname and rDNS?

  • 1 server
  • 3 domains (domain1.com, domain2.net, domain3.de)
  • 1 mail server for each domain

My current settings:

/etc/hosts

127.0.0.1 localhost
11.22.33.44 domain1.com
11.22.33.44 www.domain1.com
11.22.33.44 domain2.net
11.22.33.44 www.domain2.net
11.22.33.44 domain3.de
11.22.33.44 www.domain3.de

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

hostname

domain1.com

rDNS

domain1.com

When checking my mail server on mxtoolbox, everything is fine except for "SMTP Valid Hostname" (Reverse DNS is not a valid Hostname).

Should the hostname include one of my domains or can this be completely different, like foo.bar.com? It would be great to be able to set the servers in Thunderbird as imap.foobar.com and smtp.foobar.com like the big mail-companies do.

So, what hostname and rDNS should I choose?

John Doof
  • 179
  • 3
  • 10

3 Answers3

1

If you only have one server (and one IP), then you only have one mail server for all your three domains. A mail server should have one name, an IP can theoretically have several rDNS names but I'd only recommend one, and mail is really the only protocol where the rDNS is important, so, since you only have one IP, I'd use mail.oneofyourdomains.tld. You can always use smtp.* and imap.* to configure you mail clients if you wish to.

For the domain, I'd choose mail.domain3.de if you are in Germany, but you can choose any of your domains, like mail.domain1.com. Then make sure the DNS is OK, forward and reverse. Then make sure the mail server is working OK for all your domains, then change the MX of all your three domains to point to the one single name you chose.

However mxtoolbox should not complain that "domain1.com" is not a valid hostname if it in fact is. You say that the rDNS is domain1.com, but are your really certain? Mxtoolbox has a reverse lookup tool (ptr:11.22.33.44), does that give domain1.com as the domain name?

Law29
  • 3,557
  • 1
  • 16
  • 28
  • Well, `domain1.com` is a valid hostname if you accept the implication that your hostname is `domain1` and your domain is `com`. It's not really a good choice of hostname, even if I agree that there is a difference between this and it being invalid. – Håkan Lindqvist Mar 19 '16 at 16:48
  • Also, there is no actual upside of adding multiple reverse dns entries for an IP, especially considering that you have no control of which one is picked in any given situation. – Håkan Lindqvist Mar 19 '16 at 16:50
  • Yes, my rDNS is domain1.com - I manually changed it in my hosters control panel. The ptr-test verified it. And yes, I've ONE mail-server and it's working fine. Okay, so I'll choose mail.domain1.com - but that looks really weird to have this "mail" in my terminal. What do people who have all the stuff on one server (one IP)? Do most of 'em use mail.domain1.com as hostname? – John Doof Mar 19 '16 at 19:43
  • Two more question: Do I have to add mail.domain1.com to /etc/hosts - in my understanding I don't have to. And: Do I have to own the hostname domain or can it be a fantasy name like wow.myownserver.wow? – John Doof Mar 19 '16 at 20:00
  • Your rDNS is the primary hostname as seen from the Internet. If you don't want that in your terminal, you can configure it to be something else, but you'd need to manually configure your mail server so that is shows the same name as the rDNS. – Law29 Mar 19 '16 at 20:30
  • Personally I (usually) have only one server, I choose a name I like that distinguishes it from all the non-servers I have (desktop, laptop, kid's machines . . .) that all have their own names. – Law29 Mar 19 '16 at 20:33
  • You don't *have* to add mail.domain1.com to /etc/hosts if you're only making it the rDNS and mailname. However the rDNS absolutely needs to be a real valid hostname in a domain you control, especially for a mail server. If you want a fantasy name, it can be wow-moyownserver.domain1.com instead of mail.domain1.com, it will be visible but really only to people who want to have a look at the network configuration of your domain names. – Law29 Mar 19 '16 at 20:38
1

Your configured hostname would be expected to be something like foo.example.com, the reverse DNS entry is expected to be this hostname.

There is no actual relation between the hostname of the mailserver and which domains it handles mail for; it's completely normal to eg have a mail server foo.example.com which handles mail for eg bar.example and example.org.

I'm guessing that this test you are using is simply complaining because of your unorthodox hostname of example.com (where something like foo.example.com would be normal).

Håkan Lindqvist
  • 35,011
  • 5
  • 69
  • 94
0

It can also be a different domain, you can even have multiple rDNS on one IP for instance
one: domain1.com another:smtp.foobar.com

Ofcourse if you are not the owner of your IPs or do not have access to RIPE database (or any other RIRs) you should ask your ISP which is probably the owner of IPs to set the rdns for you.

Arash
  • 284
  • 1
  • 8
  • Multiple reverse DNS entries is not a good idea, it's not considered normal and it doesn't help anything. Also, you have no control over which of these entries will be used in any given situation. – Håkan Lindqvist Mar 19 '16 at 16:46
  • Sometimes we need to have an rDNS record pointing to a different name rather than our mx record (like here foo.bar.com) but some enterprise mail services like Gmail/Yahoo check to see if the rDNS is pointing to something other than mx record then **spam** it or put it into **junk**! So by having multiple pointers we issue this problem. – Arash Mar 19 '16 at 17:57
  • @Arash the correct answer to that problem is to have one rDNS name and then use that one rDNS name as MX for all your domains. – Law29 Mar 19 '16 at 21:36