Gmail.com mail server resolution

I am trying to find the gmail.com mail server using the dig command and checking the results returned by the dig command using telnet.

$ dig gmail.com MX ; <<>> DiG 9.7.3 <<>> gmail.com MX ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 54145 ;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;gmail.com. IN MX ;; ANSWER SECTION: gmail.com. 800 IN MX 10 alt1.gmail-smtp-in.l.google.com. gmail.com. 800 IN MX 20 alt2.gmail-smtp-in.l.google.com. gmail.com. 800 IN MX 30 alt3.gmail-smtp-in.l.google.com. gmail.com. 800 IN MX 40 alt4.gmail-smtp-in.l.google.com. gmail.com. 800 IN MX 5 gmail-smtp-in.l.google.com. ;; Query time: 14 msec ;; SERVER: 192.168.1.1#53(192.168.1.1) ;; WHEN: Tue Dec 27 02:09:50 2011 ;; MSG SIZE rcvd: 150 
Command

Dig reports that "alt1.gmail-smtp-in.l.google.com" is one of the mail servers. The smtp port 25 or 587 does not open (checked using telnet) for the link "alt1.gmail-smtp-in.1.google.com". However, the link http://support.google.com/mail/bin/answer.py?hl=en&answer=13287 says that smtp.gmail.com is the mail server for gmail.com and port 587 opens for it. Why digging gives the wrong email servers or where my understanding of reading output goes wrong.

+6
source share
1 answer

General theory

Generally speaking, an SMTP server has two different functions that are often combined: sending outgoing mail and receiving mail from other networks. These two functions are performed using the same SMTP protocol. Typically, these two functions are performed by the same machine, and historically they can be performed even on the same port. Therefore, it is easy to understand why people combine these two functions.

Although these two functions still have the same SMTP protocol, it is becoming less and less true that they run on the same port (since system administrators do not allow their clients to spam by blocking outgoing port 25 of traffic). Often SMTP transmission uses SSL encryption these days, while mail transport between two different networks is still in plain text. With the complexity of the Google network, I would not be surprised if these two functions are performed on different machines. (Disclaimer: I work for Google, but I don’t have any internal knowledge of GMail.)

  • Sending outgoing mail. When you send an email from GMail, especially when you set up an email client such as Evolution to send from your gmail account, you need to set up an SMTP server that will be used to send your mail. Your mail client connects directly to this SMTP server, and the SMTP server takes responsibility for sending the message to the right place in another place on the Internet. This is often configured using a dedicated port and requires login information so that only authorized users can send email. This is the function the support link is associated with. You are setting up your mail client to use the smtp.gmail.com domain smtp.gmail.com on port 587, and I think your mail client finds this server using the DNS A record for the usual domain name lookup.

  • Receive email from other networks. The SMTP server that sends your message to another network looks for the MX record for gmail.com (in your case, finding that the place to send the message is alt1.gmail-smtp-in.l.google.com ) and sends the message to port 25 on this host, This is what you were looking for in DIG, and tested with telnet.

    Now, why didn’t you see alt1.gmail-smtp-in.l.google.com 25 port when you tried to connect to telnet from your Internet connection to the Internet? The answer is that to prevent outgoing spam, your ISP blocks outgoing traffic on port 25. Therefore, you cannot send anything to gmail.com 25 without going through your ISP SMTP server or any other SMTP server , which requires entry and accepts applications on port 587.

What did you try to do.

So, you are trying to perform function # 2. You performed an MX search for gmail.com yourself and found that it matches the server alt1.gmail-smtp-in.l.google.com . Then you tried telnetting on port 587 at alt1.gmail-smtp-in.l.google.com . This did not work because alt1.gmail-smtp-in.l.google.com does not listen on this port (it only needs to listen on port 25 to perform function No. 2). Then you tried to connect to port 25 at alt1.gmail-smtp-in.l.google.com . This did not work because your ISP is blocking outgoing connections on port 25.

What you need to do to send an email to gmail.com will find a server that performs function No. 1 and send you an email. Also, find an ISP that is not against spamming and does not block outgoing traffic on port 25. (Actually, please do not do this.)

+15
source

Source: https://habr.com/ru/post/904510/


All Articles