Configure MX Records for Incoming SMTP E-Mail Traffic

When you want to use A Mail exchange ie MS Exchange or some thing look like Mdemon etc, without a third party smart host  and want to configure your mxrecords make sure you do every thing the right and you must understand how to setup and mx record otherwise you will always lose all or some of your emails. And when you finish you must use the following or similer website utility to check that all you have done is the right way. http://www.mxtoolbox.com/

Now use the following method to setup different types of mxrecords.

When you want to run your own mail server, and it does not matter what version and make of mail server you’re using – as long as the mail server is using SMTP as the e-mail transfer mechanism – you’ll need to configure the MX Records for your domain.

MX is an acronym for Mail eXchange. MX is defined in RFC 1035. It specifies the name and relative preference of mail servers for the zone. MX is a DNS record used to define the host(s) willing to accept mail for a given domain. I.e. an MX record indicates which computer is responsible for handling the mail for a particular domain.

Without proper MX Records for your domain, only internal e-mail will be delivered to your users. External e-mail from other mail servers in the world will not be able to reach your server simply because these foreign servers cannot tell to which server they need to “talk” (or open a connection to) in order to send the mail destined for that domain.

You can have multiple MX records for a single domain name, ranked in preference order. If a host has three MX records, a mailer will try to deliver to all three before queuing the mail.

MX Records must be in the following format:

domain.com.    IN    MX   10     mail.domain.com.

The Preference field is relative to any other MX Record for the zone and can be on any value between 0 and 65535. Low values are more preferred. The preferred value is usually 10 but this is just a convention, not a thumb rule. Any number of MX Records may be defined. If the host is in the domain it requires an A Record. MX Records do not need to point to a host in the same zone, i.e. an MX Record can. point to an A Record that is listed in any zone on that DNS or any other DNS server.

External and Internet-connected networks

When connecting your mail server to the Internet (or to another ex-organizational mailing system that uses SMTP) you must always make sure that the rest of the world can successfully resolve your domain’s MX Record. Failing to do so will cause e-mail traffic not to be delivered to you.

In order to properly configure your domain’s MX Record you should contact your ISP (Internet Service Provider) or the party responsible for hosting your DNS Domain name. They will ask you for your FQDN (Fully Qualified Domain Name) and IP address of your mail server. Make sure you know them.

When your mail server is connected directly to the Internet

In cases where no NAT (Network Address Translation) is being used and where your mail server is directly connected to the Internet, you will need to provide them with the FQDN and IP address of your mail server.

Note: This is, by far, the least secure method for connecting a mail server to the Internet.

Let’s say you have the following LAN configuration:

configure-mx-records-for-incoming-smtp-e-mail-traffic_1239681178729

In the above example you need to give the mail server’s IP address as your MX Record.

Domain name: dpetri.net

Record FQDN Record Type Record Value MX Pref
mail.dpetri.net A 212.143.143.130
dpetri.net MX mail.dpetri.net 10

 

You should make sure the ISP has had all the necessary routing tables updated in order to provide Internet availability to your internal IP network range.

Note: It doesn’t matter if the real host name of the mail server is NOT “mail”. Internet hosts don’t mind that, they just need to know what’s the name of the mail server, and what’s the IP address for that name.

When NAT is being used

In cases where NAT (Network Address Translation) is being used you will need to provide them with the IP address of your external NAT interface, and configure your NAT device with Static Mapping for TCP Port 25, and have all TCP Port 25 traffic forwarded to the internal IP address of your mail server.

Let’s say you have the following LAN configuration:

configure-mx-records-for-incoming-smtp-e-mail-traffic_1239681205487

In the above example you need to give the NAT’s IP address as your MX Record.

Domain name: dpetri.net

Record FQDN Record Type Record Value MX Pref
mail.dpetri.net A 192.90.1.1
dpetri.net MX mail.dpetri.net 10

 

Note: Make sure you properly configure the NAT device to forward all TCP Port 25 traffic to 192.168.0.10.

When a Mail Relay is being used

In cases where you have a DMZ (Demilitarized Zone) with a Mail Relay host (i.e. Linux, Windows 2000/2003 + IIS and SMTP, a dedicated appliance and so on) you will need to provide the FQDN and IP address of your Mail Relay machine, and configure the Firewall to only allow TCP Port 25 traffic to be sent to the Mail Relay’s IP address, not to your real mail server.

You should then configure the Mail Relay to forward the incoming e-mail traffic to the real mail server (after scanning it for spam, viruses and so on).

Let’s say you have the following LAN configuration:

configure-mx-records-for-incoming-smtp-e-mail-traffic_1239681227852

Your IP Address is:
38.107.179.231

This entry was posted in Microsoft. Bookmark the permalink.

Comments are closed.