get ip address for domain in shell 1

get ip address for domain in shell

$ host stackoverflow.com

stackoverflow.com has address 69.59.196.211
stackoverflow.com mail is handled by 30 alt2.aspmx.l.google.com.
stackoverflow.com mail is handled by 40 aspmx2.googlemail.com.
stackoverflow.com mail is handled by 50 aspmx3.googlemail.com.
stackoverflow.com mail is handled by 10 aspmx.l.google.com.
stackoverflow.com mail is handled by 20 alt1.aspmx.l.google.com.

Here is what the above code is Doing:
1. It’s using the socket module to connect to the mail server at the domain’s MX record.
2. It’s sending the HELO command to the mail server.
3. It’s sending the MAIL FROM command to the mail server.
4. It’s sending the RCPT TO command to the mail server.
5. It’s sending the DATA command to the mail server.
6. It’s sending the QUIT command to the mail server.

Similar Posts