Exchange DNS Configuration

AID: 2370
  • Status: Published

37381 points

  • Bydemazter
  • TypeTutorial
  • Posted on2010-02-01 at 01:11:52
Awards
  • Community Pick
  • Experts Exchange Approved
I have seen a number of questions over the past few months regarding DNS configuration for an Exchange Server. Incorrectly configured DNS can cause your server to be rejected by receiving servers that are performing certain types of checks on the mail it receives.

One of the most common of these is the rDNS lookup which basically checks that the server sending the message actually exists.

I will try to cover the correct configuration here for hosting your own mail server and sending mail out via DNS rather than a smart host. This configuration is not as important if you send via a 3rd party relay.

MX Configuration
The MX record(s) for your domain provide systems sending you e-mail with the correct path for your mail server. If you're using a relay/SPAM service then your MX record will be configured to use their servers' host names. If you host your own server, the MX record will be configured with your server's IP address.

Step 1
Confirm the External IP address your server is using. This can be achieved by simply going to http://whatsmyip.org from your Exchange Server. At the very top of the screen this will provide you with your IP address.

Step 2
Create an A record in the DNS that controls your EXTERNAL domain name. This is the DNS for the part after the @ in your e-mail address. I always use mail.domainname.com but you don’t have to. It doesn’t matter what you use as long as it’s consistent.

Step 3
You now need to configure the MX record for your main domain -- the one after the @ sign for which you want to receive email. To do this, edit the DNS settings for that domain and set the MX record to use the A record you have configured in Step 2.

Do not use IP addresses or CNAME records for the MX entry as this can throw up errors on DNS lookups and is also against RFC standards. See RFC2181: http://tools.ietf.org/html/rfc2181#section-10.3, section 10.3

Extract: "This domain name must have as its value one or more address records. Currently those will be A records, however in the future other record types giving addressing information may be acceptable.  It can also have other RRs, but never a CNAME RR."

If you only have a single connection to the internet then only setup 1 MX record, and avoid giving it a value of 0 - use 5 or 10. This will be your PRIMARY MX.

If you have a second connection to the internet that has a different IP address that you use for backup purposes in case your main line goes down then add a secondary MX with an A record that is configured for this IP address with a higher value, of say 20.

If you only have a single server, avoid the temptation to setup multiple MX records either setting up two MX records pointing to the same IP address as this is a complete waste of time, or one pointing to your own server and one pointing to a backup MX server hosted for you as this will get targeted by spammers and you will be forwarding spam from your secondary MX to your Exchange server.

Step 4
Contact your ISP as you will need to configure a Reverse DNS, also referred to as a PTR (pointer) record. This is against your IP address so can only be done by the company that provide your internet connection. Whilst a generic rDNS record will work, any systems doing strict lookup will fail your server if it doesn’t match the A record configured in Step 2 so, therefore, it is best practice to configure your rDNS to use mail.domainname.com (A record configured in Step 2)

Step 5
Modify your send connector/SMTP Connector. Depending on which version of Exchange Server you are using this process will be different.

In Exchange 2007 & 2010 the Send Connector will need to be modified.

Open Exchange Management Console, navigate to Organisation Configuration > Hub Transport > Send Connector and right click on the send connector configured for internet usage and select properties.

 
send-connector.jpg
  • 19 KB
  • send_connector
send_connector


On the first screen you will see a FQDN box. This should match the A record you created in Step 2. For consistency you may also want to do the same on the Internet Receive Connector which is located under Server Configuration > Hub Transport and by default it will be the one that starts with Default.

In Exchange 2003 you will need to modify the properties of the SMTP Virtual Server.

Open Exchange System Manager, navigate to Administrative Groups > First Administrative Group > Servers > Servername > Protocols > SMTP and right click on the Default SMTP Virtual Server select properties.

 
smtp-vitual-server.jpg
  • 20 KB
  • smtp_virtual_s
smtp_virtual_s


Under the delivery tab click Advanced and enter the A record you created in Step 2 for the Fully Qualified Domain Name

Summary

In summary then your DNS configuration should look like this:

•A record mail.domainname.com configured for IP address of your server
•MX record for domainname.com configured to use A record mail.domainname.com
•rDNS configured to use mail.domainname.com
•Send Connector/Receive Connector in Exchange 2007 FQDN set to: mail.domainname.com
•SMTP Virtual Server in Exchange 2003 FQDN set to: mail.domainname.com
    Asked On
    2010-02-01 at 01:11:52ID2370
    Tags

    MX

    ,

    Exchange

    ,

    DNS

    Topic

    Exchange Email Server

    Views
    13572

    Comments

    Expert Comment

    by: mboppe on 2010-02-03 at 22:04:20ID: 9100

    Couldn't understand the below

    "If you only have a single server, avoid the temptation to setup multiple MX records either setting up two MX records pointing to the same IP address as this is a complete waste of time, or one pointing to your own server and one pointing to a backup MX server hosted for you as this will get targeted by spammers and you will be forwarding spam from your secondary MX to your Exchange server"

    Author Comment

    by: demazter on 2010-02-04 at 00:04:06ID: 9101

    Hi mboppe.

    I struggled a bit with the wording of this section, basically some Exchange admins configure 2 MX records for the same server but just with different values (say 10 & 20) I can only assume because most DNS reports will give an error if only one MX record exists.

    Others will setup a catchall mailboxes at their ISP and point their second MX record to this.

    The problem with this is that:

    a) It will cause regular mail to be sent to your secondary MX record if your primary is temporary unavailable or under load
    b) Because of it's lower value it will be targetted by spammers because it is considered to be less protected because it is a BACKUP MX.

    Is that a little clearer? if not let me know specifically what it is your not happy with and I can try and help

    Thanks
    Glen

    Expert Comment

    by: mboppe on 2010-02-04 at 14:39:42ID: 9133

    Demazter

    So you are saying that unless a organisation has 2 public IPs pointing to 2 different servers  no point in configuring 2nd mx record.Is this right.

    And also not a good practice to configure 2nd mx record to ISP?If thats the case then say you primary record goes down and you can't bring it back within 48 hrs then you would lose the email isn't it.

    "Because of it's lower value it will be targetted by spammers because it is considered to be less protected because it is a BACKUP MX." should be Because of it's higher value isn't it.

    Author Comment

    by: demazter on 2010-02-05 at 02:13:35ID: 9150

    Lower priority rather than value.

    "And also not a good practice to configure 2nd mx record to ISP" absolutely, becuase this will result in mail being sent to your ISP if you primary MX is temporarily unavailable or under load.

    Author Comment

    by: demazter on 2010-02-05 at 02:17:31ID: 9151

    Have a read of: http://blog.sembee.co.uk/archive/2007/02/02/38.aspx from Mestha EE's top Exchange Expert and Microsoft Most Valued Profesional for Exchange

    Expert Comment

    by: mboppe on 2010-02-07 at 15:39:48ID: 9264

    Thanks Demazter
    Great Article

    Expert Comment

    by: flf4eva on 2010-02-13 at 17:01:25ID: 9628

    Thank you

    Expert Comment

    by: YohanF on 2010-03-04 at 02:51:55ID: 10430

    Nice one!

    Expert Comment

    by: cshell_1987 on 2010-03-19 at 14:01:41ID: 11234

    Good job!

    Expert Comment

    by: acampos on 2010-10-12 at 10:14:14ID: 20397

    demazter, once again thank you for your excellent articles.

    I have one question. I have multiple domains being managed by my Exchange 2010. Basically each user in AD is linked to a set of email addresses. for example

    AD user: De Mazter is assigned De.Mazter@mydomain1.com, @mydomain2.com, etc etc. but all of them pointing to one mailbox.

    i had my IPS to create a RDNS pointing to domain1.com which is my main domain (the one with a certificate also for web access). https:/mail.mydomain1.com/OWA

    my question is... why after all these steps, i am still getting Warning - Reverse DNS does not match SMTP Banner when i go to mxtoolbox.com.

    Also, i am getting a lot of rejected emails from comcast, att, cox... like if we were in black list or our RDNS wouldnt be configured correctly. RDNS it's correct as far as i know.

    Thank you

    Author Comment

    by: demazter on 2010-10-12 at 10:20:16ID: 20398

    Check the SMTP banner on your Receive connector you will probably find it doesn't match your rdns?

    The multiple domain issue is irrelevant.

    Basically you have it setup as follows:

    A record = mail.domain1.com
    MX record for domain1.com = mail.domain1.com
    RDNS = mail.domain1.com

    And if you really want to be sure send and receive connectors should also be mail.domain1.com.  Send connector is the important one the receive connector not so important (this is the one you are getting an error for)

    Then MX record for domain2.com = mail.domain1.com and MX record for domain3.com = mail.domain1.com so basically all mx records use the A record that your rDNS is configured to match.

    Does that make sense?

    Expert Comment

    by: JaredJ1 on 2011-01-12 at 05:57:10ID: 22786

    Author Comment

    by: demazter on 2011-03-01 at 02:10:52ID: 24168

    I didn't forget to mention them I deliberately left them out. :)

    SPF records are still not widely used and a missing SPF record is actually better than a misconfigured one which is why I didn't refer to them.

    Expert Comment

    by: Claimtrust on 2011-03-10 at 11:44:20ID: 24592

    Great article, very helpful.

    I also have a question, I have 2 different domains (abc.com and xyz.net), in 2 different forests , both are running Exchange 2007. I want to setup users in domain abc.com to have an email address xyz.net was well as abc.com email address. Do I just setup a PTR for xyz.net to point to the ip address of abc.com?
     If so, does that cause any email routing issues externally? If that is not the best way to do it, any other suggestions how?

    Expert Comment

    by: jaramart on 2011-05-02 at 17:59:08ID: 26178

    Howdy i was wondering if someone could help? I am trying to set up my exchange server i am running SBS 2008 with exchange 2007 all in the one box. When i run the configure internet address wizard it does not let me choose .org.au as an option. thus i choose to configure it myself.

    at the moment i have three DNS "zones"
    1. Forward look up zone
    2. Reverse lookup zone
    3. Conditional Fowarders.

    Am i supposed to have an external Zone? if so where do i create this? how am i supposed to do this?

    Basically what is happening when a user logs on the there computer and runs outlook 2007 it starts the email config wizard and searches for the email settings and comes back with my local domain name longridgerv.local but it should come back with longridge.org.au when i manualy enter this and users name and password and click connect it instantly pops up with welcome back to remote.longridge.org.au and asks for a user name and password when i enter it there it just keeps poping up til it finally says cannot connect. What am i missing?

    One other thing i had one user out of 50 connect straight away no problems but now it just keeps asking for password

    Expert Comment

    by: Hieristie on 2011-10-27 at 20:25:42ID: 32830

    Good article!

    I still have a question. Do I still have to change my FQDN on my internal mail server when using a UTM which sends and receives the mail on the outside, say smart host? I configured that with the name of the MX and A record where my domain is hosted? My PRT, A an MX records are pointing to my internal mail server on my local domain and the MX and A record (unable to add a PRT) with my domain hosting partner are pointing to my static ip, which will be forwarded to the UTM.

    Add your Comment

    Please Sign up or Log in to comment on this article.

    Join Experts Exchange Today

    Gain Access to all our Tech Resources

    Get personalized answers

    Ask unlimited questions

    Access Proven Solutions

    Search 3.2 million solutions

    Read In-Depth How-To Guides

    1000+ articles, demos, & tips

    Watch Step by Step Tutorials

    Learn direct from top tech pros

    And Much More!

    Your complete tech resource

    See Plans and Pricing

    30-day free trial. Register in 60 seconds.

    Loading Advertisement...

    Top Exchange Experts

    1. demazter

      724,144

      Sage

      1,580 points yesterday

      Profile
      Rank: Genius
    2. alanhardisty

      714,931

      Sage

      4,220 points yesterday

      Profile
      Rank: Genius
    3. jjmck

      275,745

      Guru

      1,030 points yesterday

      Profile
      Rank: Genius
    4. Rajkumar-MCITP

      268,093

      Guru

      0 points yesterday

      Profile
      Rank: Guru
    5. apache09

      245,757

      Guru

      1,500 points yesterday

      Profile
      Rank: Genius
    6. akicute555

      178,820

      Guru

      0 points yesterday

      Profile
      Rank: Wizard
    7. amitkulshrestha

      171,436

      Guru

      0 points yesterday

      Profile
      Rank: Genius
    8. acbrown2010

      159,135

      Guru

      1,000 points yesterday

      Profile
      Rank: Genius
    9. Akhater

      153,366

      Guru

      0 points yesterday

      Profile
      Rank: Genius
    10. Neilsr

      137,804

      Master

      0 points yesterday

      Profile
      Rank: Genius
    11. jordannet

      127,611

      Master

      10 points yesterday

      Profile
      Rank: Wizard
    12. GreatVargas

      101,542

      Master

      2,800 points yesterday

      Profile
      Rank: Wizard
    13. HendrikWiese

      95,084

      Master

      2,050 points yesterday

      Profile
      Rank: Sage
    14. limjianan

      94,700

      Master

      0 points yesterday

      Profile
      Rank: Genius
    15. endital1097

      93,710

      Master

      10 points yesterday

      Profile
      Rank: Genius
    16. Anuroopsundd

      92,000

      Master

      0 points yesterday

      Profile
      Rank: Sage
    17. davorin

      91,351

      Master

      0 points yesterday

      Profile
      Rank: Sage
    18. Radweld

      88,729

      Master

      0 points yesterday

      Profile
      Rank: Guru
    19. chakko

      88,498

      Master

      0 points yesterday

      Profile
      Rank: Genius
    20. R--R

      86,699

      Master

      0 points yesterday

      Profile
      Rank: Wizard
    21. e_aravind

      85,998

      Master

      0 points yesterday

      Profile
      Rank: Genius
    22. Exchange_Geek

      85,704

      Master

      0 points yesterday

      Profile
      Rank: Sage
    23. lucid8

      81,809

      Master

      0 points yesterday

      Profile
      Rank: Sage
    24. KalluSureshKumar

      76,534

      Master

      0 points yesterday

      Profile
      Rank: Master
    25. tigermatt

      73,020

      Master

      0 points yesterday

      Profile
      Rank: Genius

    Hall Of Fame