What Is Mx Record
If you have a question about what is MX record in DNS, how it works and how to setup MX record.
We will discuss this post about it and will see how we can set up this in exchange.
In a simple and easy word, Mx record is used as a mail exchanger.
It determines the IP address of the host machine where emails have to be sent.
Basically, by setting an It is a DNS, you tell the server where email should land.
It is necessary to set up this info to DNS in order to receive emails from other domains.
How MX Record Works
Let’s take an easy example: Suppose you have a domain abc.com.
So, you have an email address on that domain for example email@example.com
Whenever the external user sends an email to firstname.lastname@example.org it will do a query to a DNS server.
Therefore, first It looks for an authoritative name server for abc.com.
Usually, this name server is provided by the service provider like GoDaddy from where you bought your domain.
Once the query reaches to the domain name “abc.com”
It looks for this entry in a DNS zone file of that domain.
An MX record is an entry in the DNS zone pointing to the IP of your server, where emails are hosted.
Now sent email from external user gets the IP address of the server, where it can land.
Finally, email lands to the inbox of email@example.com
If this record is not present, then your domain abc.com cannot receive an email.
Note: If you are using an exchange server internally.
You may sent and receive emails but not from external users.
What Is Mx Priority
You can configure multiple MX records for your domain name.
Having multiple records in your GoDaddy DNS can work as a backup.
Now, you have multiple records, then how email understands where to go.
That’s the MX record priority come into a play.
It decides which IP should be used first to deliver emails.
The lowes priority 0, means the highest preference.
The highest priority 10 means lower preference.
Now if you set the IP (x.x.x.x) to 0 priority.
The email will be delivered to the IP having the lowest priority.
If you are thinking what is my MX record and want to know the IP address of this.
You can use the command nslookup to determine your record.
MX record example for abc.com is Mail.abc.com, use the below command to know the IP
Example: nslookup mail.abc.com
How To Setup Mx Record
You can log in to the service provider portal for the DNS management.
For Example in my case, I have a domain techijack.in
I want my email URL to be mail.techijack.in.
First, create a host a record by the name of the mail and point it to the email server IP.
If you are using NAT or Firewall, Put the public IP of your router or firewall.
Second Create a new record and select the type as MX
Now put the domain name or @ in a name field and type mail.abc.com in the content field.
As I am using Cloudflare DNS so my record appears as below
There can be a different service provider for the domain.
So, you have to contact your domain provider to manage the DNS.
DNS propagation can take some time like around 24-48 hrs to propagate.
Exchange is highly dependent on DNS and it should be configured properly.
To check your Mx record Vist Mxtoolbox
Watch the below video to configure it for your exchange server.