22
Last Edited: 11/4/2005 1 ©IBM 2005 Telnet Lesson Overview Introduction Telnet, like NSLookup, is a key tool for troubleshooting inbound and outbound Internet (SMTP) mail issues. As a Domino Server Administrator, you might consider using Telnet if you are having trouble sending or receiving Internet mail for your an entire domain or for a particular Domino server. Objectives After completing this lesson, you will be able to: Explain two reasons to use Telnet in troubleshooting Internet routing issues Use Telnet to connect to a server to confirm port 25 is open to receive Inbound Internet messages Use Telnet to determine what application is listening for inbound Internet messages on port 25 Use Telnet to send a test message to a particular user on a Domino server In this Lesson This lesson is divided into the following topics: Topic See Page Introduction to Telnet 2 Combining Multiple Tools 3 The Telnet Dialog 4 Using Windows 2000/XP Version of Telnet 8 Exercise: Using Telnet to Troubleshoot Routing Issues 12 Appendix: How to Use the Windows GUI version of Telnet 18 Timing The timing of this lesson’s components is as follows: Component Approximate Time Lessons/Lesson Overview 30 minutes Exercise 30 minutes Total: 1 hour

Telnet Lesson Overview - Del Mar Collegeacademy.delmar.edu/Courses/ITSC1358/eBooks/Using Telnet to Trou… · Telnet Lesson Overview Introduction Telnet, like NSLookup, is a key tool

  • Upload
    others

  • View
    45

  • Download
    0

Embed Size (px)

Citation preview

Last Edited: 11/4/2005 1 ©IBM 2005

Telnet

Lesson Overview

Introduction Telnet, like NSLookup, is a key tool for troubleshooting inbound and

outbound Internet (SMTP) mail issues. As a Domino Server Administrator, you might consider using Telnet if you are having trouble sending or receiving Internet mail for your an entire domain or for a particular Domino server.

Objectives After completing this lesson, you will be able to:

• Explain two reasons to use Telnet in troubleshooting Internet routing

issues • Use Telnet to connect to a server to confirm port 25 is open to receive

Inbound Internet messages • Use Telnet to determine what application is listening for inbound

Internet messages on port 25 • Use Telnet to send a test message to a particular user on a Domino

server

In this Lesson This lesson is divided into the following topics:

Topic See Page Introduction to Telnet 2 Combining Multiple Tools 3 The Telnet Dialog 4 Using Windows 2000/XP Version of Telnet 8 Exercise: Using Telnet to Troubleshoot Routing Issues 12 Appendix: How to Use the Windows GUI version of Telnet 18

Timing The timing of this lesson’s components is as follows:

Component Approximate Time Lessons/Lesson Overview 30 minutes Exercise 30 minutes Total: 1 hour

Last Edited: 11/4/2005 2 ©IBM 2005

Introduction to Telnet

Overview Telnet is a multifaceted tool that can perform many functions. Telnet is

available on a variety of platforms, however, this lesson will use the Windows version. Our focus on Telnet is specific to troubleshooting SMTP Internet mail issues. In particular, you would use Telnet for the following three reasons:

Reason to Use Telnet

Details

1 To determine whether port 25 is open to receive inbound Internet mail. Note: Port 25 is the well-known TCP port for SMTP.

For a domain to receive inbound Internet mail, an SMTP server (such as a Domino server configured for SMTP) must be listening on port 25 and must be accessible from external hosts. If you can establish a connection to that server over port 25 using Telnet, you can confirm that the port is open to receive inbound mail.

2 To identify what application is currently bound to port 25 (for sending and receiving SMTP messages).

Although multiple applications can be running on a server, only one can be bound to port 25. In particular, a Domino server configured for SMTP cannot send or receive Internet mail if another application has bound to port 25. When you establish a connection to a server over Telnet, you can identify the application that is currently bound to the port.

3 To build and send a test Internet message to a particular SMTP server listening on port 25.

Sending a message via Telnet is a means to test whether it’s possible to send and receive a message using the commands designated for SMTP.

Last Edited: 11/4/2005 3 ©IBM 2005

Combining Multiple Tools for Testing

NSLookup and Telnet – Often Used in Combination

When troubleshooting SMTP Internet mail issues, Administrators frequently use NSLookup and Telnet in combination. The following scenario describes one way these tools can be used together to troubleshoot an issue. Typical Scenario: An Administrator determines that her company (978388 Co.) is not receiving any Internet mail that is sent to its domain (978388.com) by external senders. A Domino 6.5.4 server to setup and configured to receive all inbound SMTP mail for the domain. It has already been confirmed that Domino SMTP Listener task is enabled on the Server document. Troubleshooting: • The first step would be to verify the MX records for xyz.com are present

in DNS using NSLookup. Typically, most will have 2 MX records listed for a given domain. The host with the lowest MX preference would be the first choice to connect to.

• The next step would be to use Telnet to attempt a connection to the host

with the lowest preference on port 25. If the Connection is established but the banner message displayed does not indicate a Domino 6.5.4 Server is running, another SMTP application could have this port.

Results: If Domino does not have use of port 25, its ability to receive inbound Internet mail is unlikely. Changes would be needed on the local machine, so that the other SMTP application no longer binds to port 25. Once the port is free, the Domino SMTP server would able to bind to port 25 and receive inbound Internet mail as intended.

Why use Telnet too?

In the previous example, Telnet could be used to determine if the SMTP servers listed in the MX record is capable of receiving mail for a given domain or recipient. Telnet allows you, as the Administrator; to emulate the exact behavior for sending messages manually, it would be done as if the message was sent by an SMTP server.

Last Edited: 11/4/2005 4 ©IBM 2005

The Telnet Dialog

A Telnet Session is a Dialog

With Telnet, you are in a dialog with a server (the host). When you enter a Telnet command, the host responds. The host’s response is either a positive response or an error. • A positive response indicates that the host recognizes and accepts the

command. Positive responses begin with a numeric code in the 200’s. • An error indicates that the host either does not recognize or cannot

accept the command. There are two types of errors.

1. Transient errors (temporary errors), which begin with a numeric code in the 400’s.

2. Permanent errors, which begin with a numeric code in the 500’s.

RFC821 A Telnet dialog over port 25 corresponds to the RFC (Request for Comments)

standards for SMTP: RFC821. For more information, refer to: http://www.ietf.org/rfc/rfc821.txt?number=821

Telnet Dialog Begins with the Connection

The Telnet dialog begins when you successfully connect to the host. In most cases, the host’s initial response includes two particularly important pieces of information: • The number 220, indicating connection was established. (This

information confirms for you that port 25 is open.) • The host’s application type, such as Domino, Sendmail (a UNIX-based

mail program), or Microsoft Exchange. (This information tells you whether the intended application is bound to port 25.)

It is important to note, however, that Administrators can customize the response a server generates. You may not always see the host’s application type. “Proper” implementations return at least the 220-response code and the date.

Continued on next page

Last Edited: 11/4/2005 5 ©IBM 2005

The Telnet Dialog, Continued

Examples of Successful Connections

Below are two examples of responses from hosts after successful connections were established via Telnet. Example 1: Response from a Domino server: 220 mailserver1.lotus.com ESMTP Service (Lotus Domino Release 7.0) ready at Wed, 19 Oct 2005 09:29:42 -0400 Example 2: Response from Sendmail: 220 mailserver100.boulder.ibm.com ESMTP Sendmail 8.12.11/8.12.11; Wed, 19 Oct 2005 07:31:25 -0600

If Connection Attempt Fails

If a connection to a host cannot be established over Telnet, you will see a message such as the following: Microsoft Telnet> open wtfmail0500.lotus.com 25 Connecting To wtfmail0500.lotus.com... Could not open connection to the host, on port 25: Connect failed Possible reasons for a failed connection include the following: • The port is blocked by a firewall. • The server is down.

• The server is not running the SMTP service. (For a Domino server, this

means the SMTP listener task is not enabled.) • An incorrect TCP/IP port is listening on a multi-homed server.

Continued on next page

Last Edited: 11/4/2005 6 ©IBM 2005

The Telnet Dialog, Continued

Dialog Continues with the Message

Once you establish a connection to the server, the dialog continues as you build and then send the test Internet message. As you enter each command, the host responds with either a positive (250) response or an error. Again, the error may be a transient error (in the 400’s) or a permanent error (in the 500’s). A sample dialog is below: Helo mailserver100.boulder.ibm.com 250 mailserver100.boulder.ibm.com Hello [9.17.195.170], pleased to meet you. mail from:[email protected] 250 [email protected]…Sender ok recpt to:[email protected] 500 Command not recognized “recpt to: [email protected]” rcpt to:[email protected] 250 [email protected]…Recipient ok data 354 Enter mail, end with “.” on a line by itself This is a test message sent by John to Jane via Telnet. . 250 Message accepted for delivery

In this dialog, most of the responses were positive, but one 500 error was returned when a command was entered incorrectly. Note: For more information on the response codes that you can see in a Telnet conversation with a host over port 25 (SMTP), refer to the following Lotus Knowledge Base document: Document 1153776, What Are the Available SMTP Reply Codes?

Continued on next page

Last Edited: 11/4/2005 7 ©IBM 2005

The Telnet Dialog, Continued

Dialog Termination

The Telnet connection remains active after the message is sent. To terminate the connection either exit Telnet using the UI or type quit (and press ENTER). For example: quit 221 mailserver100.boulder.ibm.com closing connection Note: If you do not manually terminate the connection, the server will drop the connection after the designated amount of time (usually, after 2 minutes of inactivity).

Telnet Guidelines

On the next page, we’ll actually connect to a host via Telnet and send a test message. First, however, consider the following guidelines for using Telnet. Do… • Turn on Local Echo so that you can see the commands you are typing. • Use the proper syntax for each command; otherwise, the host will

generate a 500 error.

Don’t… • Use either the Backspace or Delete key. Telnet does not recognize

either key. If you mistype a command, you must retype the entire command. Using the BACKSPACE or DELETE key in an attempt to correct a mistyped Telnet command causes a 501-error code (a syntax error). In the data fields, the BACKSPACE and DELETE keys cause garbage characters, such as pipe symbols and squares.

Don’t need to… Bother with the case of the Telnet commands. Any combination of upper and lower case characters is accepted. (On UNIX platforms, you may need to pay attention to the case of certain elements, such as file names.)

Last Edited: 11/4/2005 8 ©IBM 2005

Using Windows 2000/XP version of Telnet

Introduction Unlike previous versions of Windows, the Windows 2000/XP does not

include a GUI-based version of Telnet. As a result, you must issue manual commands to perform the following steps: • Open the connection with the server • Set local echo • Disconnect from the server

The procedure below lists the steps to Telnet a message to an SMTP server using a Windows 2000/XP client.

Before You Begin

To use the procedure below, you must know either the fully qualified domain name or the IP address for the server to which you wish to connect.

Procedure – For Win2k/XP

To Telnet to a Domino server over the SMTP protocol, follow these steps:

Step Action

1 From the Windows 2000/XP task bar, select Start and then Run. 2 In the Run dialog box, enter Telnet and click OK.

Result: The following window displays:

3 Turn on Local Echo by typing the following command:

set local_echo

Press Enter

Continued on next page

Last Edited: 11/4/2005 9 ©IBM 2005

Using Windows 2000/XP version of Telnet, Continued

Procedure – For Win2k/XP (continued)

Step Action 4 Connect to the Domino server via the appropriate command.

To connect using the server’s…

Type…

hostname

Open <hostname> 25

IP Address Open <IPAddress> 25 Result: If the server is listening on port 25, the Telnet window displays a 220 connection message.

5 Create the message using the steps below: Command Description a Type helo <hostname> and

press ENTER. Note: ehlo can be used to conduct the conversation in ESMTP mode.

In the helo command, the host sending the command identifies itself. The command can be interpreted as saying “Hello, I am <Domain>.”

b Type mail from: <your valid email address> and press ENTER.

This step fills in the from field of the message. The name should be a valid address so that you can receive, if necessary, a delivery failure.

c Type rcpt to: <recipient’s Internet address> and press ENTER.

This step fills in the SendTo field. The name entered must be a valid Internet address.

d Type data and press ENTER.

This step signals the beginning of the data fields.

Continued on next page

Last Edited: 11/4/2005 10 ©IBM 2005

Using Windows 2000/XP version of Telnet, Continued

Procedure – For Win2k/XP (continued)

Step Action 5

con’t

Command Details e Optional:

Type cc: <recipient> and press ENTER.

This step fills in the cc: field.

f Optional: Type date: <date> and press ENTER.

This step fills in the date field.

g Optional: Type from: <> and press ENTER.

This step fills in the from field. If included, it overrides the address used in the mail from specified in Step b.

h Type subject: <your subject> and press ENTER.

This step fills in the subject field.

i Type the body of the message and press ENTER.

This step creates the body text of the message.

j Type a period: . and press ENTER.

This step signals the end of the body field, and the message is sent.

Result: The following message displays at the bottom of the Telnet window: 250 Message accepted for delivery

6 To disconnect from the current host, type quit and press Enter. 7 To close the window, click the or type exit and press Enter.

Note: Other optional entries can be included within the data command. For more information, refer to RFC821: http://www.ietf.org/rfc/rfc821.txt?number=821

Last Edited: 11/4/2005 11 ©IBM 2005

Using the GUI version of Telnet on Windows 2000/XP

Obtaining a GUI-Based Telnet for Win2K/XP

According to Microsoft, you can copy the executable file for the GUI-based Telnet program from Windows NT 4.0 to Windows 2000. The steps to do this are listed in the table below.

Step Action

1 Obtain a copy of the TELNET.EXE file from a Windows NT 4.0 system. Note: The file should be located in the c:\winnt\system32 folder.

2 Make a copy of the file and rename the copy to TELNET32.EXE. 3 Copy TELNET.EXE to the Windows 2000 system. 4 Optional: Copy the TELNET.HLP and TELNET.CNT files from

Windows NT to the folder where you copied TELNET32.EXE into Windows 2000.

On-Line Instructions

The steps to use the Windows NT 4.0 GUI-based version of Telnet in Windows 2000 are available online in the following Lotus Knowledge Base document: Document 1095047, The GUI Version of Telnet in Windows 95, 98, and NT Can be Used in Windows 2000

Last Edited: 11/4/2005 12 ©IBM 2005

Exercise: Using Telnet to Troubleshoot Routing Issues

Overview This exercise is designed to reinforce your ability to use Telnet in

troubleshooting routing issues.

Timing The timing for this exercise is as follows:

Component Approximate Time Overview 1 minuteExercise 20 minutesRecap 9 minutesTotal: 30 minutes

Intended Outcome

In completing this exercise, you will demonstrate your ability to… • Explain two reasons to use Telnet in troubleshooting Internet routing

issues • Use Telnet to connect to a server to confirm port 25 is open to receive

Inbound Internet messages • Use Telnet to determine what application is listening for inbound

Internet messages on port 25 • Use Telnet to send a test message to a particular user on a Domino

server

Requirements To complete this exercise, you need the following:

• A pen • Telnet • The procedure: How to Telnet Using Windows 2000/XP. • The FQDN of your inbound SMTP server: _____________________

The name of a local test user to send messages to: __________

Continued on next page

Last Edited: 11/4/2005 13 ©IBM 2005

Exercise: Using Telnet to Troubleshoot Routing Issues, Continued

Instructions There are two parts to this exercise.

• In Part 1, you will use Telnet to establish a connection to an SMTP host (a

Domino server) and send a message. Along the way, you will describe why you are performing certain steps and track the responses from the server.

In Part 2, you will provide short answers to a set of scenarios on troubleshooting with Telnet.

Part 1 – Telnet Follow the steps in the table below and answer the corresponding questions.

Step Action Answers 1 Load Telnet and set local echo.

What is the reason local echo should be enabled?

2 Connect to your SMTP server. a. What port did you specify for SMTP? b. What is the numeric response returned by the server? c. What type of application is the server?

a. b. c.

3 Enter the Helo command. What is the response returned by the server?

Continued on next page

Last Edited: 11/4/2005 14 ©IBM 2005

Exercise: Using Telnet to Troubleshoot Routing Issues, Continued

Part 1 – Telnet (continued)

Step Action Answers 4 Using the following

commands, send a test message to one of your mail users. mail from: rcpt to: data subject: What is the response when the message is successfully sent?

5 Send a second message in which you deliberately mistype one of the commands. For example, type rpt to: instead of rcpt to: a. What is the response code indicating an error? b. How do you correct the mistyped command?

a. b.

Continued on next page

Last Edited: 11/4/2005 15 ©IBM 2005

Exercise: Using Telnet to Troubleshoot Routing Issues, Continued

Part 1 – Telnet (continued)

6 Disconnect from the server.

Disable the SMTP listener task on your server (tell it to quit). Now attempt to reconnect to the server via Telnet on port 25. What response do you get from the server?

Part 2 – Short Answer

Provide short answers to each of the following scenarios.

Scenario 1 Your Response

As the Administrator, you’ve attempted to configure a server, running Domino 7.0, to receive all inbound mail sent to your company’s domain (AFakeCompany.com). However, no messages sent to your domain by external senders are getting to the intended recipients. You have used NSLookup to identify that there is a single MX record in DNS for a server within that domain: smtp.AFakeCompany.com. What two things would you attempt to determine about the smtp.AFakeCompany.com server using Telnet?

Continued on next page

Last Edited: 11/4/2005 16 ©IBM 2005

Exercise: Using Telnet to Troubleshoot Routing Issues, Continued

Scenario 2 Your Response

You’ve received a report from one of your fellow Administrators, who is currently working on an SMTP mail routing issue. You attempted to assist and have used Telnet to connect to an SMTP server and sent a test message to this person. She reports that the test message arrived, but it has garbage characters (such as squares) in the message body. Do these odd characters indicate yet another problem with her SMTP configuration? What is the most likely reason for the garbage characters?

Scenario 3 Your Response

Your help desk reports that all Internet messages sent from your company to a key business partner (somebuspartner.com) are resulting in non-delivery notifications after a 24-hour period. The outbound SMTP server is running Domino 6.5.4. You’ve determined that all other outbound Internet messages are routing correctly. Using NSLookup, you determined that the business partner’s Internet domain has no MX records, but it does have an A record. You attempt to connect to the server listed in the A record via Telnet, but an error occurs: “Could not open a connection to inbound.somebuspartner.com.” At this point, what can you say “with certainty” is needed to fix this? What are some possible causes for this issue?

Continued on next page

Last Edited: 11/4/2005 17 ©IBM 2005

Exercise: Using Telnet to Troubleshoot Routing Issues, Continued

Scenario 4 – (BONUS) Your Response

You’ve recently switched ISP’s and now are unable to send any outbound SMTP mail. Your outbound SMTP servers are using a relay host so from the Domino prospective, your configuration has not changed. How might you verify the connection to the relay? Where is the relay defined in the Domino Directory? Is there anything you needed to do on the Domino side to accommodate the change to the new internet service provider?

Results In completing this exercise, you have demonstrated your ability to…

• Explain two reasons to use Telnet in troubleshooting Internet routing

issues • Use Telnet to connect to a server to confirm port 25 is open to receive

inbound Internet messages • Use Telnet to determine what application is listening for inbound Internet

messages on port 25 • Use Telnet to send a test message to a particular user on a Domino server

Last Edited: 11/4/2005 18 ©IBM 2005

Appendix: How to Use the Windows GUI version of Telnet

Overview Telnet (TELNET.EXE) is a TCP/IP terminal application that is available on

most Operating Systems. The procedure below describes how to use the version of Telnet that is included with Windows 95, Windows 98, and Windows NT 4.0.

Before You Begin

Before using the procedure below, you must know either the fully qualified domain name or the IP Address for the server to which you wish to connect via Telnet.

Procedure - How to Telnet

To connect to an SMTP host and send a message via Telnet, follow the steps below.

Step Action

1 From the Windows 95, 98 or NT 4.0 task bar, select Start and then Run.

2 In the Run dialog box, enter Telnet and click OK. Result: The following Telnet window displays:

Note: The Telnet executable can be launched a number of ways. If you prefer, you can launch Telnet from a DOS prompt or configure a shortcut for the Windows desktop.

Continued on next page

Last Edited: 11/4/2005 19 ©IBM 2005

Appendix: How to Use the Windows GUI version of Telnet, Continued

Procedure - How to Telnet (continued)

Step Action 3 Turn on Local Echo. To do this:

a. From the menu, select Terminal, Preferences. b. Under Terminal Options, select Local Echo. c. Click OK.

4 From the menu, select Connect, Remote System.

Continued on next page

Last Edited: 11/4/2005 20 ©IBM 2005

Appendix: How to Use the Windows GUI version of Telnet, Continued

Procedure - How to Telnet (continued)

Step Action 5 In the Connect dialog box:

a. Enter the appropriate Host Name or IP Address. b. Change the port from Telnet to the appropriate number

(such as 25 for SMTP). c. Leave TermType at the default (vt100).

Result: The Connect dialog box resembles the following:

6 Click Connect. Result: If the server is listening on port 25, the Telnet window displays the 220 response and additional information, such as the following:

Continued on next page

Last Edited: 11/4/2005 21 ©IBM 2005

Appendix: How to Use the Windows GUI version of Telnet, Continued

Procedure - How to Telnet (continued)

Step Action 7 Create the test message using the steps below:

Command Details a Type helo <hostname> and

press ENTER. Note: ehlo can be used to conduct the conversation in ESMTP mode.

In the helo command, the host sending the command identifies itself. The command can be interpreted as saying “Hello, I am <Domain>.”

b Type mail from: <your valid email address> and press ENTER.

This step fills in the from field of the message. The name should be a valid address so that you can receive, if necessary, a delivery failure.

c Type rcpt to: <recipient’s Internet address> and press ENTER.

This step fills in the SendTo field. The name entered must be a valid Internet address.

d Type data and press ENTER.

This step signals the beginning of the data fields.

e Optional: Type cc: <recipient> and press ENTER.

This step fills in the cc: field.

f Optional: Type date: <date> and press ENTER.

This step fills in the date field.

g Optional: Type from: <name> and press ENTER.

This step fills in the from field. If included, it overrides the address used in the mail from specified in Step b.

Continued on next page

Last Edited: 11/4/2005 22 ©IBM 2005

Appendix: How to Use the Windows GUI version of Telnet, Continued

Procedure - How to Telnet (continued)

Step Action 7

con’t

Command Details h Type subject: <your subject>

and press ENTER. This step fills in the subject field.

i Type the body of the message and press ENTER.

This step creates the body text of the message.

j Type a period: . and press ENTER.

This step signals the end of the body field, and the message is sent.

8 Result: The following message displays at the bottom of the

Telnet window: 250 Message accepted for delivery

9 To disconnect from the current host, type quit and press ENTER. Alternately, you can select Connect and then Disconnect from the Telnet menu. At this point, you can connect to another host if you wish; or, to exit Telnet, proceed to Step 10.

10 To exit from Telnet, either select Connect, Exit or click the x to close the window.

Note: If, at any point during the conversation you would like to start sending a new message, enter the rset command. (Type rset and then press ENTER.) The rset command brings the session back to the mail from command, at which point you can start again. You do not need to repeat the helo command because the session is already established with the host.