Member-only story

How to troubleshoot “Failed to connect to xxx.xxx.xxx port xx: No route to host” error in a Linux machine like Fedora, RHEL, and Ubuntu

Bryant Jimin Son
2 min readFeb 14, 2021

--

As you are trying to connect to an IP address/hostname with a curl, you might get an error similar to the following:

sh-4.4# curl xxx.xx.xx.xxx
curl: (7) Failed to connect to xxx.xx.xx.xxx port xx: No route to host

There can be few reasons why you might get an error message like above.

  1. Nothing is running on the hostname/IP address with the respective port.
  2. Firewall or other security is blocking for you to access

Let’s see how you can troubleshoot a problem like this.

PROBLEM SCENARIO #1: Nothing is running on the hostname/IP address with this respective port

In this case, if you have a sudo privilege for the server that exposes that particular IP address/hostname, try to run a command that shows ports that are in “LISTENING” status. In Fedora, for example, you can run a command like this:

--

--

Bryant Jimin Son
Bryant Jimin Son

Written by Bryant Jimin Son

A cloud practitioner talking about technology, travels & career tips. But I will sometimes cover financial advises and some random stuffs.

No responses yet