What are Traceroute, Ping, Telnet and Nslookup commands?




Traceroute


Traceroute is one of the most common utilities built into most operating systems. It is useful for diagnosing network connections. It shows the path of a packet going from your host/computer through each of the individual routes that handle the packet and time required for it to go from one router to another up to the final host/destination.


How it works

When you start the traceroute command, it sends a packet (using the Internet Control Message Protocol or ICMP) with a time limit value (known as the 'time to live' - TTL). The first packet has a TTL of 1, the second packet has a TTL of 2, etc. Increasing TTL in such a manner, it resends the packet so that you can reach the first, the second and other routers on the way to the destination. When a router receives the packet, it sends a Time Exceeded message, which provides an opportunity to determine the time required for the hop to the router. Each time a packet is passed to a new router, the TTL is decreased by 1. When it reaches 0, the packet is discarded, and the router returns an error message.

Traceroute determines that the packet has reached the destination by including a port number that is outside the normal range. When it’s reached, the Port Unreachable message is sent in return, which defines the time length of the final hop. Traceroute provides you with the information hop by hop. Each hop is determined three times. When a website is unreachable or slow, traceroute allows you to see where the connection fails or has delays.


How to use traceroute

  • For Windows

Perform the following actions to run the tracert command:

1. Select the Start button > click on the Run option.

2. In the command line, type in cmd and press Enter.

3. Input:

tracert *******

You need to use the domain name, the server's name or its IP instead of *******.

4. Press Enter.

  • For macOS

In order to run traceroute, follow the steps below:

1. From your hard drive, open the Applications folder and click to open the Utilities folder.

2. Double-click Terminal.

3. Input:

traceroute -I -e ******* 

You need to use the domain name, the server's name or its IP instead of *******.

4. Press Enter.

  • For iPhone

In order to run a traceroute command on iPhone, you need to set up a special app, for example, iNetTools - Ping,DNS,Port Scan.
Once it is uploaded, navigate to the Trace Route menu :



Paste your domain name, server name, or its IP address in the input box and click Start. The output will be shown in the Result window:


  • For Android

Traceroute can be checked on Android in the Network Utilities app.
After installing, click on the three-horizontal-lines menu icon in the left upper corner to see the list of utilities the application provides:


Navigate to the Traceroute menu and paste the domain name, server`s name, or server`s IP address and choose Trace to get the output:


How to read traceroute

Here are the most common examples of a traceroute output, which can help to investigate the issue:

  • Example 1



As we can see, traceroute to nctest.info (162.213.255.51) means that we are trying to reach the nctest.info domain which resolves to 162.213.255.51 IP address.

  • Example 2



When you can’t access your website, cPanel or email account and results look like this, it means that your computer can’t reach the server. It usually happens because your IP is blocked on the server. You need to contact our hosting support via live chat or the ticket system in order to check the IP.

  • Example 3



When your website is slow and you get *** Request timed out and high latency from the beginning, it means that the connection to the server is unstable.
When you see a trace like this, it means overall poor quality of connection, and you can try connecting to cPanel/website using another ISP/different connection.


Understanding errors

Unable to resolve target system name domain.comDomain is not registered or does not exist.
Unknown host domain.com

Timeout

Tracing route to domain.com [64.13.192.208]

over a maximum of 30 hops:

 

1    <1 ms    <1 ms    <1 ms  72.10.62.1

2    <1 ms    <1 ms    <1 ms  10.101.248.1

3        *        *        *  Request Time Out

4        *        *        *  Request Time Out

5        *        *        *  Request Time Out

6        *        *        *  Request Time Out
A network/firewall issue that is preventing you from reaching your server, or your local ISP may drop ICMP traffic.
A or !X

Administratively prohibited (example, access-list).

The network administrator has blocked traceroute at this router.
QSource quench (destination too busy).
IUser interrupted test.
UPort unreachable.
HHost unreachable. The router has no route to the target system.
NNetwork unreachable.
PProtocol Unreachable.
TTimeout.
?Unknown packet type.
!SSource route failed. You tried to use source routing, but the router is configured to block source-routed packets.
!FFragmentation needed. This indicates that the router is misconfigured.



Ping


The ping command is used to determine the ability of a user’s computer to reach a destination computer.

The main purpose of using this command is to verify if the computer can connect over the network to another computer or network device. It also helps to find out the IP address using the host name:



  • For Windows

1. Select the Start button > click on the Run option.

2. In the command line, type in cmd and press Enter.

3. After that, type in one of the following commands and press Enter:

ping domain.tld

ping IP_address

4. Ping continues to run until you stop it. Press Ctrl+C to end the command.

  • For macOS

1. From your hard drive, open the Applications folder and click to open the Utilities folder.

2. Double-click Terminal.

3. After that, type in one of the following commands and press Enter:

ping domain.tld

ping IP_address

4. Wait for some time and then stop it. Press Ctrl+C to end the command.

  • For iPhone

In order to run the Ping command, go to the menu list in the iNetTools app and choose the Ping option. Enter the domain name or the server`s IP address and click the Start button to get the output:


  • For Android

To get the result of the Ping command on your Android phone, access the Network Utilities application and navigate to the Ping menu option. Paste your details, i.e. domain name, server name, or IP address and press the Ping button:



Telnet


The telnet command is used for connection and communication with a remote or local host via the Telnet TCP/IP protocol.

You can enter a domain or IP address and try connecting to it via the chosen port. In case the port is not specified, telnet utility tries to connect via the default port 23.  

The command is really useful in cases when you need to check whether the needed port is open on your computer and on the side of the remote host.


How to use Telnet

  • For Windows

Telnet is disabled on Windows by default. To enable it, perform these steps:

1. Press the Start button > Control Panel:



2. Go to the Programs section:



3. Select Programs and Features > Turn Windows Features on or off:



4. Scroll down the list available in the Windows Features window > check Telnet Client option > press OK > wait a few moments for the changes to be applied:



5. Telnet is enabled now, so we can run it in the same way as other commands:
  • Select the Start button > click on the Run option.
  • In the command line, type in cmd and press Enter.
  • After that, type in the following and press Enter:

telnet [domain name or IP] [port number]

for example:

telnet namecheap.com 80



If you see the blank output after that, you have connected successfully. To quit you can press CTRL + C or any key:



As a result of successful telnet, we can conclude, that the entered domain or IP exists, and the chosen port is open on your computer and on the side of the target host.

If connection has not been established, the following error will appear:



Possible reasons for it are:
  • domain or IP does not exist/not available/entered with a typo
  • the chosen port is closed by a security software or via network configurations on your computer or on the side of the host you connect to
  • connection/networking issue has occurred


  • For macOS

1. Select Go menu > Applications:



2. Find and press Utilities:



3. Go to Terminal:



4. Now you can run the command:

telnet [domain name or IP] [port number]

for example:

telnet namecheap.com 80

NOTE:
telnet command was removed in High Sierra version. However, macOS provided built in nc (netcat) option that can be used instead of telnet:

nc [domain name or IP] [port number]

Successful connection will look this way:



To close the session, type quit and press Enter.


Possible errors

  • Connection refused. telnet: Unable to connect to remote host



This error means, that the entered port is closed on the source or a destination host or the IP address/host is not available.

  • nodename nor servname provided, or not known



The error is displayed, when you entered
  • an unregistered domain
  • a domain with a typo
  • local domain not available in your local network
  • a domain, which does not have proper nameservers or A-record set.
Also, DNS resolution issue or ISP connection issue is possible.



Nslookup


The Nslookup command is a DNS lookup utility. You can use the following commands to look up the information for a selected hostname:

  • nslookup hostname - provides an A record for the hostname:



  • nslookup -type=RecordType hostname - gives the specified record for the set hostname (i.e., if you enter nslookup -type=txt hostname it will provide you with the txt record, etc.):



  • nslookup hostname nameserver (nameserver address or nameserver IP address) - provides you with a DNS record stored in the specified DNS server:





That's it!

Need any help? Contact our HelpDesk

Updated
Viewed
68484 times

Need help? We're always here for you.

notmyip