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

I just read Jeff Atwood's recent post on DNS configuration for email and decided to give it a go on my application.

I have a web-app that runs on one server under two different IPs and domain names, on both HTTP and HTTPS for each:

<VirtualHost *:80>
  ServerName foo.org
  ServerAlias www.foo.org
  ...
</VirtualHost>
<VirtualHost 1.2.3.4:443>
  ServerName foo.org
  ServerAlias www.foo.org
</VirtualHost>

<VirtualHost *:80>
  ServerName bar.org
  ServerAlias www.bar.org
  ...
</VirtualHost>
<VirtualHost 2.3.4.5:443>
  ServerName bar.org
  ServerAlias www.bar.org
</VirtualHost>

I'm using GMail as my SMTP server.

Do I need the reverse PTR and SenderID records? If so, do I put the same ones on all of my records (foo.org, www.foo.org, bar.org, www.bar.org, ASPMX.L.GOOGLE.COM, ASPMX2.GOOGLEMAIL.COM, ..)?

I'm pretty sure I want the domain-keys records, but I'm not sure which domains to attach them to. The Google mail servers? foo.org and bar.org? Everything?

Later

All mail that the system sends comes from an ___@foo.org address, regardless of which domain the user uses. The domains point to the exact same code and the code doesn't care about domains as far as email is concerned.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Create records for each of the “domain name” parts of the addresses you send from. So, if you send as @foo.org and @subdomain.foo.org and @bar.com, I’d create entries in all three. In the case of SPF, you can use include:<domain> to only specify things in one place (indeed, if you’re using GApps on a domain, you’ll want to use include:_spf.google.com rather than specifying Google’s servers directly (especially as the ones Google publishes and advises you to use as your MX records are the outbound mail servers).

Regarding the PTR records: you only need one PTR for each IP, and it should point to a FQDN which resolves back to that IP. It doesn’t have to bear much relation to anything other than this, but some particularly inbound mail servers may prefer that it matches the hostname used in the EHLO when you establish an ESMTP connection to them.

share|improve this answer
    
All mail comes from an @foo.org address, regardless of which domain the user uses. So that's a PTR record for 1.2.3.4, a PTR record for 2.3.4.5, a domain-key record for foo.org, and an SPF record for foo.org with includes for all the Google servers? –  James A. Rosen Apr 21 '10 at 21:06
1  
You’ll probably only need a PTR record for one of the two IPs if you know that outbound connections will only ever use that IP, but there’s no harm (and not very much extra work) in setting up PTRs for both. Otherwise, yes — that’s it exactly. –  Mo. Apr 21 '10 at 21:21

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.