Remote mail involves the usage of SMTP thus sendmail needs the name resolution to route the mails. For this sendmail uses DNS or uses /etc/hosts.
Find the FQDN of a host
# hostname -f
Sendmail DNS Usage:
Sendmail performs the DNS lookup for the defined host address and gets the IP address and then delivers the msg to the destination.Remote hosts either accepts the mail or Routes the mail using any local mailer or Relays to another destination upon the configuration.
#sendmail -v email@example.com
MX is a special type of DNS record called as Mail Exchanger Record.When mail server actualy query a Domain for direct mail, they query the dns server for the MX record and once found sendmail will attempt to direct the mail to destination according to the priority of MX record.
Normally an "A" record is enough to get the IP address of the host for sendmail to send the mail.But MX is used because to distinguish/identify the mail servers in the given domain
#sendmail -v firstname.lastname@example.org
(So in nameserver the MX record entry for mail1.india is added to the domain mydomain.com; Make sure that we have a 'A' record created for the same MX record)
This means any the mail comes to email@example.com will be routed to mail1.india.mydomain.com to process with.
Backup MX & Priority in MX:
mydomain.com. 14000 IN MX 20 mail2.india.mydomain.com.
mydomain.com. 14000 IN MX 10 mail1.india.mydomain.com.
If a backup MX server is running make sure that the user mail box is located in the backup mail server as well.