# How to check hostname reachability?

Once you have made sure the [DNS resolution is successful](how-to-check-dns-resolution), you can move on to the next step to verify if the hostname is reachable on the required port.

If you are using a proxy, you should run this from that proxy system.

To verify this, you can try running the [`telnet`](#command-telnet) or alternative command from the terminal based on your OS and terminal. If it is not reachable, you can try running the [`tracert` or `traceroute`](#command-traceroute) or alternative command from the terminal based on your OS or terminal. For more information, refer to the guide on [how to check hostname reachability](#hostname-reachability-guide).

If you have multiple ISPs, then we recommend you to test this on each of those ISPs. Very rarely, the problem may not be in your firewall, but may be in the ISP.

If, for whatever reasons, the hostname is not reachable on the port 443, raise a support ticket with your infrastructure and network service provider to check the configuration in your Proxy and/or Firewall as applicable.

{% hint style="info" %}
**Note**: The hostname reachability has to be consistent and successful at any point of time from all the instances from where the API request might be made in future.
{% endhint %}

{% hint style="success" %}
**Next**: If this step is successful, it only means that your system is now able to reach our hostname on port 443. It still does not confirm that the hostname is trusted by your system.
{% endhint %}

## Hostname reachability guide

List of various commands and the terminals in which it will work.

<table><thead><tr><th width="166">Commands</th><th width="180">Command Prompt</th><th width="142">GitBash</th><th>Ubuntu</th></tr></thead><tbody><tr><td>telnet</td><td>YES</td><td>YES</td><td>YES</td></tr><tr><td>tracert</td><td>YES</td><td>YES</td><td>NO</td></tr><tr><td>mtr</td><td>NO</td><td>NO</td><td>YES</td></tr></tbody></table>

\* Some commands may require you to enable the feature or install the tool in the OS before using.

## Command - telnet

### Steps to run telnet in Command Prompt

The `telnet` command is used to establish a connection to a remote host over a network using the Telnet protocol.&#x20;

It allows a user to connect to a server and perform various operations, such as sending data and receiving responses.&#x20;

Here is an example of a "telnet" command to connect to the "api-sandbox.clear.in" server on port 443 (which is the default port for HTTPS).

For running this command, make sure that the telnet client is installed.

Go to command prompt and type the below command

**Sandbox:**

```
telnet api-sandbox.clear.in 443
```

<figure><img src="https://lh4.googleusercontent.com/abCwSSQDJpfNaPWim8z8NMDsLIcoK__1dSgKi_1OTczbBdt7WFm9u3JMnd-7LgWPvtAnp5zxugm0UKceSPuyhMKz3dns_FcttWJFETwoM6FeYzlAuSN4sCqbkCceYQRvPcVicNQM6pdrQHTSOr3pGkg" alt=""><figcaption></figcaption></figure>

If you get a blank screen with a blinking cursor that means the hostname is reachable until you terminate with Ctrl+C

<figure><img src="https://lh4.googleusercontent.com/fE_UQMF6eqXvMdDvzDJUpEVmLfl7xzz5gzEBx-0qpiuwvFEyyrIMR3-uDegRXc4gPRx7_ZJ_HHO23yFWmkPZY5bZlOu851CnFYJuoIQDYibWyRCM0tDBVnAXLoWH5YwIG0aUtqiNxbH5-he25GoFpp0" alt=""><figcaption></figcaption></figure>

For error scenarios  you will get a message as below.

<figure><img src="https://lh6.googleusercontent.com/R64NeQIeVJ9P4oYtAonPW2onIEgFeZb9la04gPXdxP6IUZnRCozocM7V3m2JeczxhpRCNOAhdWtJH9Iegr_zmexZ6al52XUDOpY_sW6WQ59hn1POMRB7CtSVXSkuHqLpurSl5UP21bz5KVGr1I9CmSc" alt=""><figcaption></figcaption></figure>

Repeat the same with the below hostname as well.

```
telnet storage.clear.in 443
```

**Production:**

```
telnet api.clear.in 443
```

<figure><img src="https://lh5.googleusercontent.com/RT-phgz2T2WX37DD8kijHL-A7CS3q5gL-lOuE6Cr8EOlXFoHVCIkl_hLrsNJ5FdBvp3AEo8JRBi7jXdU5f21y1_pbEUXXpPOiRzdiwwLuutKHysr-7ShxGrJoUydtVrxruM2OnKN29ZqS-Ii1TyKGlU" alt=""><figcaption></figcaption></figure>

Repeat the same with the below hostname as well.

```
telnet storage.clear.in 443
```

### Steps to run telnet in Ubuntu (Linux)

Make sure that the telnet client is installed before running the below command.

Open Ubuntu terminal and type the below command.

**Sandbox:**

```
telnet api-sandbox.clear.in 443
```

<figure><img src="https://lh5.googleusercontent.com/2g6kRSpyUAHpDj_LDJfhndoALj0dYLHnyhV9a4Y4xAQaXLGmAiZ8Yt5vmY0U7m7PZZzi2di3IR5FwJ7I9Mb7-XfUjAN83aKwJXsjvOvBwWOeNbnVtfAzitFXkxHaovfAMWcRhOS_Awy0KIM_e2B-bkI" alt=""><figcaption></figcaption></figure>

This output shows that the telnet connection was successful and that the server "api-sandbox.clear.in" is reachable on port 443.&#x20;

The message "Escape character is '^]'." indicates that the telnet session is now active and ready to receive commands.

Repeat the same with the below hostname as well.

```
telnet storage.clear.in 443
```

**Production:**

```
telnet api.clear.in 443
```

<figure><img src="https://lh5.googleusercontent.com/YN5Ldh2mCmQ-2QYkuhk-JFzTW17GGlxrOwDlanO037yUsEgx9ZigwuWuvDJiFSg_Pc2CqG4cgsDTDagCKxEGePiLpbIDMp2ciLGZbp-3E1CqL3cON_KmmW03Ob2QLC6fq-T7pgpbIkMzCSSmPwFOdeU" alt=""><figcaption></figcaption></figure>

This output shows that the telnet connection was successful and that the server "api.clear.in" is reachable on port 443.&#x20;

The message "Escape character is '^]'." indicates that the telnet session is now active and ready to receive commands.

Repeat the same with the below hostname as well.

```
telnet storage.clear.in 443
```

### Steps to run telnet in GitBash

We cannot directly run telnet from GitBash, we will need to use winpty along with telnet to check the hostname reachability as below.

**Sandbox:**

```
winpty telnet api-sandbox.clear.in 443
```

<figure><img src="https://lh3.googleusercontent.com/Oxs0aZhhyLDEV75eT8vffVJgrgA4hIGkpg7OCzw9ynE_KcrEdavtoHiHLtOcapxNZgZBfexuKnlh-kOOMIp6QWYFlS06mVChEhiIPW9mb1MLdYapw13YqWKymbPpp7TMy2ZYhADYH3ywSachL7gERVI" alt=""><figcaption></figcaption></figure>

Repeat the same with the below hostname as well.

```
winpty telnet storage.clear.in 443
```

**Production:**

The `winpty` command is used on Windows systems to enable a Windows command prompt to interact with command-line applications that use a Unix-style terminal interface.&#x20;

The `telnet` command, on the other hand, is used to establish a connection to a remote host over a network using the Telnet protocol.

Assuming that you have a valid hostname for the "api.clear.in" server and that it is reachable on port 443, you can use the following command to establish a Telnet connection on a Windows system using the "winpty" command:

```
winpty telnet api.clear.in 443
```

<figure><img src="https://lh6.googleusercontent.com/AvhH3rbzGkULavM80O3q07w4gnKfLcsUTpwcJ-qVctt58qVOu0TezchYDhbUER3Q_oqYCztzC0Nx9B5ZqzESd1jY14Ar25yPEMb_mm88azQGEGSdRiPQ0p73lsU5gX7RJk_LXG_LVii5Qx-oiMeXYsQ" alt=""><figcaption></figcaption></figure>

If for whatever reasons, the hostname is not reachable on the port 443, then your Network team needs to review the route all the way from your terminal to the Clear server using the tracert or traceroute command.

Repeat the same with the below hostname as well.

```
winpty telnet storage.clear.in 443
```

## Command - traceroute

### Steps to run traceroute (tracert) in Command Prompt

Traceroute is a command you use to 'trace' the route that a packet takes when traveling to its destination

Go to Command prompt and run the tracert command for both sandbox and production as below.

**Sandbox:**

```
tracert api-sandbox.clear.in
```

<figure><img src="https://lh5.googleusercontent.com/5PRE6xaAEMhy1w4V590rO4a8EAri6N5R_O6v8d3608PqWZHueFnxyTEtyQxULu2sYHoL787wXE5rY5lRhbi7dTU6ejPC5n4yfxdqUKPZkUmpfEXUgWtSilO-xkwsXPwoO3qnVsd2J2nKjl19Lk3w9MM" alt=""><figcaption></figcaption></figure>

Note, the number of hops may vary in your system, which is okay. The key thing here is to verify the source IP (which should be your local IP) and the destination IP in the last (which is our AWS global accelerator IP - one of the 2 mentioned above).

This output shows the route that the packets took to reach the "api-sandbox.clear.in" server.&#x20;

The output displays each hop between the source and destination, along with the IP address of the router or device at each hop, and the time it took for the packet to travel from one hop to the next. The last hop indicates the destination server's IP address, which is 75.2.104.91  in this case.

Repeat the same with the below hostname as well.

```
tracert storage.clear.in
```

**Production:**

```
tracert api.clear.in
```

<figure><img src="https://lh5.googleusercontent.com/YyLPmiicmJgXJP2Yz6GI-NHzs-zGGShY2SkGnBigcPqwE-SfZmdSKv2ApbpyD5xUPyyGX4f1khv1f8WYEfUloKqOLub5p6VYH5sQa_8XxxPh_T2T27xwQjRNOVytRdwW6r7j4h_KzwKXq0a4CtkO3xs" alt=""><figcaption></figcaption></figure>

Repeat the same with the below hostname as well.

```
tracert storage.clear.in
```

### Steps to run traceroute (tracert) in GitBash

Go to GitBash and run the tracert command for both sandbox and production hostname as below.

**Sandbox:**

```
tracert api-sandbox.clear.in
```

<figure><img src="https://lh6.googleusercontent.com/V3ZqoicBS3FjzMmKA9dcWsM7gfLQr5rQ-u7Sn-eR9je53pqIWozKiOE7tIVgsjX448M_YtHdgqdO9KDqJoqUMCeOYvKWSe380ngRaXYVDZju1wrLsASIq0g4pA7fbiflvmrii3HmY8UzyB5xFW6KCDo" alt=""><figcaption></figcaption></figure>

Repeat the same with the below hostname as well.

```
tracert storage.clear.in
```

**Production:**

```
tracert api.clear.in
```

<figure><img src="https://lh5.googleusercontent.com/sgNZ16y4lZZOt6FTnIfb57zUYOmXqEqH6WKzqz6B1IGGJpBx0Rx6GxRMo65e1I7vBBHYAUSGjzoRc9rQsCP_QTP247k1hMYtraacggjDpSrgSXCAvoTykUxLXha76Pu-q0yJEJExafgrAGWrcpnkukI" alt=""><figcaption></figcaption></figure>

Repeat the same with the below hostname as well.

```
tracert storage.clear.in
```
