Bobcares

WGET failed no route to host – How we fix it efficiently?

by | Sep 28, 2019

Got stuck by the error ‘wget failed no route to host’ while installing a new piece of software?

wget is a Linux command that helps to download files from the web.

Often ‘wget failed no route to host’ refers to a network connection error or unresponsive server.

At Bobcares, we receive requests to fix wget errors as part of our Service Management Services.

Today, let’s see the causes for Wget error and how our Support Engineers fix it.

 

What causes wget failed no route to host error?

We’ll first check on how the error appears while executing wget command. For instance, we one of our customers tried to install a software, the following error appeared.

Let’s now check the few reasons that trigger the error ‘wget failed no route to host’.

 

1. Server down

For any command to execute, the server must be up and running. The same goes for the wget command as well.

If the server is not responding or any other critical error in it then the wget command will display an error.

 

2. Port unavailability

Similarly, port unavailability can also be a reason for wget errors.

A port is a communication endpoint. Sometimes, few customization in the iptables will disable certain ports on the server. This causes errors while executing wget command.

The port number 80 is necessary for making internet communication for wget to work well. So, disabling this port ends up in an error.

 

3. Firewall block

Firewall block is one of the most common reasons for wget errors.

If there is any block set in the server by a firewall, then there are a lot of chances for the wget command not to work. In other words, a firewall filters most of the unwanted connections. Thus, the wget command failed to work.

 

4. DNS error

When the website DNS is not resolving properly, then also wget command will throw an error.

If you are trying to wget the contents from a non-resolving website, then wget cannot fetch the contents and it ends up in failure.

So it is very much important for the hostname of the website to be resolving well.

 

How we fix wget failed no route to host error?

We just saw the major reasons for the wget failed no route host error message to occur. Let’s now see how our Support Engineers fix the error message.

Recently, one of our customers got the below error message while trying to wget a website.

$ wget example.com
--2019-06-20 00:11:26--  http://example.com/
Resolving example.com (example.com)... x.x.x.x.x
Connecting to example.com (example.com)|x.x.x.x.x|:80... failed: No route to host.

Our Support Engineers started to troubleshoot by checking the server availability.

We initially executed the below command.

ping x.x.x.x

Here, the server was working well. So we went checking if there is any error in DNS propagation. And the DNS was also fine.

Further, we checked the server firewall to see if there is an IP block.

iptables -L INPUT -v -n | grep x.x.x.x

However, there was no block for the IP on the server.

Further, we checked for the port restrictions using :

netstat -plunt | grep 80

This confirmed that port 80 was not active in the server. So we used the below command to enable the port 80.

sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT

Finally, this fixed the error and wget started working.

 

[Need help in fixing the wget errors? We’ll help you.]

 

Conclusion

In short, the wget failed no route host error is mainly caused due to the firewall blockage, port restrictions or offline remote server. Today, we saw the major reasons for the wget errors and how our Support Engineers fix it.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

2 Comments

  1. Kondasz Adam

    Hi, i did the steps, but its doesent works.. i wanted to download a file(wordpress) with wget cmd on my ubuntu server, and its answers : failed: No route to host… : root@weblerszo:~/Downloads# wget https://hu.wordpress.org/latest-hu_HU.tar.gz
    –2023-01-19 00:01:05– https://hu.wordpress.org/latest-hu_HU.tar.gz
    Resolving hu.wordpress.org (hu.wordpress.org)… (myIP).
    Connecting to hu.wordpress.org (hu.wordpress.org)|(myIP)… failed: No route to host.
    root@weblerszo:~/Downloads#

    when i tried the : netstat -plunt | grep 80

    tcp6 0 0 :::80 :::* LISTEN 765/apache2
    udp6 0 0 fe80::a00:27ff:fe78:546 :::* 693/systemd-network
    i need to allow the udp6? or what? Thanks for the help

    i work in cmd.

    Reply
    • Hiba Razak

      Hi,
      Our experts can help you with the issue.we will be happy to talk to you through our live chat(click on the icon at right-bottom).

      Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF