Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

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
up vote 4 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 '', you should have a forward DNS record of '' which points to the IP 'a.b.c.d'. Your mail server should identify itself as '' when sending mail to other domains. Now you can host multiple domains/subdomains (, etc.) without setting your rDNS to anything related to

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, and SERVER.FOO. IN A, there had better be a record IN PTR SERVER.FOO.. It won't worry about and 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 -> Then setup an A record for -> 12.345.678.90 Then setup a PTR record for -> Then for each domain sending mail setup an MX record -> 12.345.678.90 and -> 12.345.678.90 etc. Will this pass email checks for providers like gmail and hotmail? Also, will this show as being sent from Thanks for your reply! – marcnewport Nov 1 '12 at 3:40

Your Answer


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.