Q. I see MX record in DNS configuration file. Can you explain the usage of MX record?
A. AN MX is short form for Mail exchanger record. The Domain Name System (DNS) stores and associates many types of information with domain names including
=> IP address
=> Host aliases
=> Email server address etc
DNS server is a general-purpose distributed, replicated, data query service chiefly used on Internet for translating hostnames into Internet addresses such as www.yahoo.com into 66.94.234.13 or vise-versa.
a) To specify IP address you need to use A record.
b) To specify Email server IP you need to use an MX record. With MX record Internet e-mail should be routed. MX records point to the servers that should receive an e-mail, and their priority relative to each other. Consider following DNS zone file for gite.in domain:
@ IN SOA gite.in ( 2007020704 ; Serial 3600 ; Refresh 300 ; Retry 604800 ; Expire 3600 ; Minimum ) @ 86400 IN ns ns1.gite.in. @ 86400 IN ns ns2.gite.in. @ 86400 IN a 75.126.43.232 www 86400 IN a 75.126.43.232 mx1 86400 IN a 75.126.43.233 mx2 86400 IN a 75.126.43.234 ns1 86400 IN a 75.126.43.233 ns2 86400 IN a 75.126.43.234 mail.gite.in 86400 IN cname mail.cyberciti.biz. 10 @ 604800 IN mx mx1.gite.in. 20 @ 604800 IN mx mx2.gite.in.
Last two line define an MX recored for gite.in mail server. So if someone send an email to user@gite.in it will be first routed to mail server called mx1.gite.in. If mx1 failed to accept an email, it will routed to 2nd mail server mx2.gite.in.
The relative priority of an MX server is determined by the preference number present in the DNS MX record. When a remote client (typically another mail server) does an MX lookup for the domain name, it gets a list of servers and their preference numbers. The MX record with the smallest preference number has the highest priority and is the first server to be tried. The remote client will go up the list of servers until it successfully delivers the message or gets permanently rejected due to an unreachable server or if the mail account does not exist on that server. If there is more than one entry with the same preference number, all of those must be tried before moving on to lower-priority entries.
See also
🐧 4 comments so far... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
I wanted to learn WHM/Cpanel concepts in depths.
Hello,
just i have to know that what are the use of MX records entries in google apps mail service
how does it works ?
Regards ,
Sunil Bhatt
Hi
I have small query
i have user like user1, user2 & user3. whereas user2/user3 is in mx2.mydomain.com
1.when someone send mail to user3@mydomain.com how it deliver the mail on mx2 server ?
2.what is maximum no for MX priority?
I would like to know how to use mx record for an rsps. i would like to know what i put in mx record.