I am reading about setting up SMTP server and almost all articles suggest to ensure that the SMTP server's name has a matching reverse lookup (PTR) entry in DNS. However, When I casually checked the gmail settings, none of its smtp servers have a matching reverse lookup.
$ dig +short gmail.com MX 20 alt2.gmail-smtp-in.l.google.com. 5 gmail-smtp-in.l.google.com. 40 alt4.gmail-smtp-in.l.google.com. 10 alt1.gmail-smtp-in.l.google.com. 30 alt3.gmail-smtp-in.l.google.com. $ dig +short alt2.gmail-smtp-in.l.google.com. 188.8.131.52 $ dig +short gmail-smtp-in.l.google.com. 184.108.40.206 $ dig +short alt4.gmail-smtp-in.l.google.com. 220.127.116.11 $ dig +short alt1.gmail-smtp-in.l.google.com. 18.104.22.168 $ dig +short alt3.gmail-smtp-in.l.google.com. 22.214.171.124 $ dig -x +short 126.96.36.199 $ dig -x 188.8.131.52 +short oj-in-f26.1e100.net. $ dig -x 184.108.40.206 +short sb-in-f27.1e100.net. $ dig -x 220.127.116.11 +short ya-in-f26.1e100.net. $ dig -x 18.104.22.168 +short pc-in-f26.1e100.net. $ dig -x 22.214.171.124 +short in-in-f27.1e100.net.
So I am bit confused. Could someone help me understand how reverse lookup is used in SMTP. Certainly I am missing this concept whle I am looking at gmail's settings.
After reading @Jacob's Answer, Here is what I found:
Below lines are from an email metadata that was received from gmail.com:
Received: from mail-qt0-f179.google.com (mail-qt0-f179.google.com [126.96.36.199]) by mx0a-00273201.pphosted.com with ESMTP id 2edpusg15b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT)
The PTR records match perfectly:
$ dig +short mail-qt0-f179.google.com 188.8.131.52 $ dig -x 184.108.40.206 +short mail-qt0-f179.google.com.
So, as I understand, I was looking at the "MX" record which is not the correct one to check for outgoing. Thanks @HBruijn for detailed explanation.
Also, I find that the email was sent from XXXX@gmail.com email address. However, the outgoing SMTP server is mail-qt0-f179.google.com which is under google.com domain (I was expecting the Outgoing SMTP server should also be in the xxxxx.gmail.com domain).