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.
64.233.168.26
$ dig +short gmail-smtp-in.l.google.com.
74.125.130.27
$ dig +short alt4.gmail-smtp-in.l.google.com.
173.194.219.26
$ dig +short alt1.gmail-smtp-in.l.google.com.
74.125.28.26
$ dig +short alt3.gmail-smtp-in.l.google.com.
74.125.201.27
$ dig -x +short 64.233.168.26
$ dig -x 64.233.168.26 +short
oj-in-f26.1e100.net.
$ dig -x 74.125.130.27 +short
sb-in-f27.1e100.net.
$ dig -x 173.194.219.26 +short
ya-in-f26.1e100.net.
$ dig -x 74.125.28.26 +short
pc-in-f26.1e100.net.
$ dig -x 74.125.201.27 +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.
UPDATE
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 [209.85.216.179])
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
209.85.216.179
$ dig -x 209.85.216.179 +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).