Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a machine (centos 5) with one external ip address. On that machine I have many virtual hosts with a few different top level domain names and sub-domains under those eg.

sub1.domain1.com
sub2.domain1.com
sub3.domain1.com
sub1.domain2.com
sub2.domain2.com
sub1.domain3.com

And so on... A lot of these different sites need to send mail as their corresponding domain (or second-level domain at least).

I need to set up DKIM, SPF (but that's handled on the DNS) and rDNS lookup so the mail gets received. As I understand it, you can only have one rDNS entry per machine. I could set up a server for each top level domain, but I'm thinking that'll get expensive.

What should I do here? Is there a way to have multiple rDNS lookups on one ip address? How do I setup DKIM signing for multiple domain names on the one machine? Are there any services out there that could handle this for me?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Contrary to the myth, you do not need to have the rDNS domain set as the domain part of 'From' address in email. You need to match the 'Mail From' /'Envelope Sender' address domain only. So if your IP 'a.b.c.d' has a rDNS of 'mail.example.com', you should have a forward DNS record of 'mail.example.com' which points to the IP 'a.b.c.d'. Your mail server should identify itself as 'mail.example.com' when sending mail to other domains. Now you can host multiple domains/subdomains (example.net, sub.example.net etc.) without setting your rDNS to anything related to example.net.

Each 'From' address domain should have an appropriate SPF and DKIM record. DKIM records protect domain based reputation when sharing IP with other domains.

share|improve this answer

You actually could have two rDNS records (strictly, IN PTR records) for one IP address. However, the results are usually not what you want (a random one of the two will typically be picked).

The appropriate thing to do is pick a hostname for your mailserver acting as a mailserver. Then, define that server in your IN MX records for each domain you have mail for. Following that, create SPF records (IN TXT) that specify the server as authorized to send mail for your domain; create one such record for each domain using the one hostname you have chosen.

rDNS checks for spam protection are usually looking at whether your host has rDNS at all, and whether the rDNS matches the DNS for the MX record (eg. if there is a record DOMAIN.BAR. IN MX 0.0.0.0, and SERVER.FOO. IN A 0.0.0.0, there had better be a record 0.0.0.0.in-addr.arpa IN PTR SERVER.FOO.. It won't worry about server.foo and domain.bar being different.

If your SMTP server doesn't support having a DKIM key for each domain it sends for, you could possibly use the same key for each (and create a new DKIM record using the same private key for each domain).

share|improve this answer
    
Okay, so if I set the rDNS as 12.345.678.90 -> server.name Then setup an A record for server.name -> 12.345.678.90 Then setup a PTR record for 90.678.345.12.in-addr.arpa -> server.name Then for each domain sending mail setup an MX record mysite.com -> 12.345.678.90 and sub.myothersite.com -> 12.345.678.90 etc. Will this pass email checks for providers like gmail and hotmail? Also, will this show as being sent from server.name? Thanks for your reply! –  newmarc Nov 1 '12 at 3:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.