DNS and Mail

In our earlier example, in the section on SMTP, we managed to telnet to port 25 on the MTA and send some mail. This was easily accomplished, as we knew the name of the machine that we wanted to connect to.

However, if we are sending mail to a different domain, we need to locate the name of the machine that handles mail for the domain; that is, the MTA. Once we know this, we can connect to it and perform the same task. To do this we use a DNS lookup, which will search for the domain's Mail Exchange (MX) records. These records are used to indicate the mail server. For example, if we search for the MX records for Sun's domain, we may see something similar to the following:

 hydrogen# nslookup Server: antimony.solarisbootcamp.com Address: ...

Get Solaris™ Operating Environment Boot Camp now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.