Tuesday, January 25, 2011

DNS setup for subdomain on different IP for dev box to support mail serving

I have two servers with IP as follows:

ServerA IP 1.2.3.4 is production
ServerB IP 5.6.7.8 is development and testing (QA/Staging to be built)

ServerA has A record and ReverseDNS setup for example.com, ServerA has CNAME records for www, foo and bar which each point to example.com

I expect to set up ServerB's DNS entries to be identical to ServerA's entries -- except domain name would be dev.example.com. and www.dev.example.com, foo.dev.example.com and bar.dev.example.com resolve to ServerB's IP.

In particular, I want ServerB hosted apps to be able to send mail that won't be generally rejected by most mail servers due to questionable DNS setup

I suspect that this setup may not pass muster -- is it valid for ServerA example.com DNS not to make reference to the subdomain dev.example.com?

Will mailservers accept mail from host dev.example.com if the reverse DNS matches the IP for dev.example.com, even if example.com has no DNS entries related to dev subdomain?

  • You don't mention what DNS software you're using, so I'm assuming bind. Creating sub-domains is easy, just a case of typing it as you expect it to be. If you want to delegate DNS for the subdomain, that becomes a little harder. We'll assume the same DNS servers will be hosting both domain, and subdomain (As a side note, www, foo, and bar are all subdomains).

    dev        A      5.6.7.8
    dev        MX 10  dev
    www.dev    CNAME  dev
    foo.dev    CNAME  dev
    bar.dev    CNAME  dev
    

    Easy as pie. You can save yourself some typing, using the $ORIGIN keyword.

    $ORIGIN dev.example.com.
              A      5.6.7.8
              MX     dev
    www       CNAME  dev
    bar       CNAME  dev
    foo       CNAME  dev
    

    If you really want the dev.example.com zone to be hosted else where, I suggest reading up about zone delegation, and grabbing yourself a copy of the book DNS and Bind.

    As for the mail handling. The above sets up inbound mail records, however outbound is quite different. This kind of setup isn't likely to cause an issue with mail delivery, assuming the host announces itself properly, has a valid PTR record, doesn't exist on any black lists, and all the other reasons mail might not get delivered.

    marfarma : Thank you. I was afraid I was wasting my time waiting for the DNS to propagate. (Sorry for confusing the other guys!) In the mean time DNS settings have propagated and I was able to confirm acceptance of email sent from the dev.example.com domain. As you indicate, barring other issues (missing PTR record, IP blacklists, etc) there is no issue sending mail from an otherwise properly configured subdomain (dev.example.com) where the DNS settings for the root domain (example.com) have no entries that relate to that subdomain. [I've only ever setup a subdomain as a CNAME entry before this.]

0 comments:

Post a Comment