Overview
This article explains how to run the traceroute network tool to check the network connection between two locations.
Prerequisites
To run the commands in this article, you must use an SSH terminal on your computer.
If you need to troubleshoot a connection from your website to an external location, you would need to create a shell user and log into your server via SSH.
Background
The traceroute command can help diagnose connection issues between different servers and locations. Below are some examples of when a traceroute might be needed to troubleshoot an issue that you are experiencing.
- Website slowness — Run a traceroute from your computer to your website to see if there are networking issues between your location and the DreamHost server.
- Email client timeouts — Run a traceroute to determine the quality of the connection to the mail server.
Example of output
This example connects to imap.dreamhost.com and lists all hops (connections) from your local computer to the end destination.
C:\Users\DreamHost> tracert imap.dreamhost.com Tracing route to imap.dreamhost.com [64.90.62.162] over a maximum of 30 hops: 1 <1 ms <1 ms <1 ms 192.168.106.1 2 1 ms <1 ms <1 ms 216.112.17.9.ptr.us.xo.net [216.112.17.9] 3 29 ms 28 ms 28 ms ae1d0.mcr1.santaana-ca.us.xo.net [216.156.1.58] 4 11 ms 11 ms 11 ms 216.156.16.70.ptr.us.xo.net [216.156.16.70] 5 25 ms 25 ms 25 ms 216.156.16.63.ptr.us.xo.net [216.156.16.63] 6 30 ms 30 ms 30 ms 209.48.213.194 7 30 ms 30 ms 30 ms pdx1-cr-1.sd.dreamhost.com [66.33.200.2] 8 45 ms 42 ms 43 ms ip-66-33-200-25.dreamhost.com [66.33.200.25] 9 30 ms 30 ms 30 ms pop.dreamhost.com [64.90.62.162] Trace complete.
The above example shows no timeouts on the network connection. If timeouts are listed, there may be a network-related issue occurring.
How to run a traceroute
Running a traceroute is slightly different depending on your operating system.
Using Windows
- Open the Command Prompt.
- Type in the word tracert followed by a space and then followed by the name of the site/server to which you’d like to connect. For example, to connect to example.com:
C:\Users\DreamHost> tracert example.com
- Press the Enter key to run the tool.
Using Linux
For most Linux distributions, you’ll need to first install the traceroute package.
- Open your terminal.
- Install using sudo (in Ubuntu):
[server]$ sudo apt-get install traceroute
- Run the command once it is installed:
[server]$ traceroute example.com
Some Linux distributions require you to also specify the protocol after -I. For example:
[server]$ traceroute -I ICMP example.com
Using macOS
- Open a terminal by pressing command + the spacebar and then typing the word terminal. Click the terminal application in the list to open.
- Type in the word tracert followed by a space and then followed by the name of the site/server to which you’d like to connect. For example, to connect to example.com:
C:\Users\DreamHost> tracert example.com
- Press the Enter key to run the tool.
Copying and pasting the results
If you’d like to share your results with DreamHost support, you will need to paste the results into a support ticket or chat.
Windows
- In the Windows command prompt, right-click and choose Mark.
- Drag your mouse over the entire area you wish to copy.
- Right-click again.
You can then paste the results into any text editor or your support ticket.
Another option is to have traceroute results written directly to a text file. To create a text file, run the following command:
C:\Users\DreamHost> tracert example.com > C:\tracert.txt
This creates a file named tracert.txt within your C:\ directory.
macOS & Linux
Run the following command to write the traceroute result to a file named trace.txt under the user's home directory.
[server]$ traceroute example.com > /home/username/trace.txt