Using Telnet emulation to check HTTP status codes

Last Modified

Wed Nov 30 21:56 GMT 2016

Description

In order to confirm access to a web resource, whether it is the N-able N-centralServer or a Web Page, it sometimes can be necessary to emulate the connection that a web browser performs.

The Telnet command allows us a means of performing this emulation manually. Telnet is a user command that uses the Internet standard protocol for remote terminal connections.

Environment

  • N-able N-central 6.5 and higher

Solution

Process

Examples will be provided for Windows and Linux. The general format for using Telnet from the command line is as follows:

Format:

telnet <IP address or FQDN> <Port>

For this example, we wish to confirm HTTP (Port 80) responsiveness of 'www.n-able.com':

telnet www.n-able.com.com 80

Windows

Z:> telnet www.n-able.com.com 80 Connecting To www.n-able.com... 

Linux/Unix

 [root@hwp root]# telnet www.n-able.com 80 Trying 69.42.109.120... Connected to www.n-able.com Escape character is ']'.

Once you have established whether or not you have port connectivity, you can then further test the availability of such services such as HTTP or HTTPS, even SMTP commands can be issued via a Telnet session to send an email.

Testing HTTP Availability and Response

Once you have established the session, the following commands can be issued to invoke an HTTP request. Note that when doing this on a Windows machine, the text you type will not appear as you type it and the backspace key will not function. Be sure to type carefully.

 HEAD / HTTP/1.0 

<ENTER><ENTER> denotes hitting the 'Enter' key on your keyboard twice.

The resulting response will depend, but a Normal HTTP response code is 200 OK

Windows

Linux