No Route to Host error and solution

by nixcraft on May 5, 2006 · 16 comments

I am getting error that read as No Route to Host. I am trying to ping my ISP gateway as well as DNS server but I am getting this error. How do I solve this problem?

This problem indicate networking conflicts or some sort of networking configuration problem.

Here are things to check:

Can you ping to your local router interface (such as 192.168.1.254)?

Make sure your card (eth0) is properly configured with correct IP address and router address. Use ifconfig command to configure IP address and route command to setup correct router address. If you prefer to use GUI tools:

  • redhat-config-network - Works on Red Hat and Fedora Linux/Cent OS.
  • network-admin - Debian and Other Linux distribution use this GUI too

Use above two GUI tools to setup correct IP address, DNS address and router address.

b) Make sure firewall is not blocking your access

iptables is default firewall on Linux. Run following command to see what iptables rules are setup:
# /sbin/iptables -L -n

You can temporary clear all iptables rules so that you can troubleshoot problem. If you are using Red Hat or Fedora Linux type command:
# /etc/init.d/iptables save
# /etc/init.d/iptables stop

If you are using other Linux distribution type following commands:
# iptables -F
# iptables -X
# iptables -t nat -F
# iptables -t nat -X
# iptables -t mangle -F
# iptables -t mangle -X

c) Finally make sure you are using a router and not a proxy server. Proxy servers are good for Internet browsing but not for other work such as ftp, sending ICMP request and so on.

See also:

Featured Articles:

Share this with other sys admins!
Facebook it - Tweet it - Print it -

We're here to help you make the most of sysadmin work. So, subscribe!

{ 16 comments… read them below or add one }

1 CALLISTO MUPFUNYE March 5, 2007

I’m using Redhat 7.3 and running sendmail for my email but the emails are not getting out the email server which is my linux 7.3 box and if I run the command # sendmail -v -q from the command prompt, it tries to send but with an error message saying “no route to host” ?

SOS

Reply

2 nixcraft March 5, 2007

Make sure you have correct routing setup. Also check file /var/log/message for details.

Make sure you have correct DNS setup. Finally some ISP do block access to 3rd party SMTP server to avoid spam.

On a side note RH7.2 is outdated get latest version such as CentOS 4.x or Fedora Core.

Reply

3 Ajayan Alphonse April 11, 2008

hi
very useful , my problem solved against no route to host

Reply

4 Kumar August 22, 2008

with regards to your suggestion “Make sure you have correct routing setup. Also check file /var/log/message for details.” above, could you tell me how to look and setup routing.
Thanks
Kumar

Reply

5 Kumar August 22, 2008

In the error logs I see this.
bound to 192.168.0.165 — renewal in 294 seconds.

Do I have to make any changes in the DHCP server.

Thanks

Reply

6 chabza May 19, 2009

thanks a lot guys, my problem solved also. linux rocks :-)

Reply

7 addhe June 10, 2009

here it is, i have 2 Computer, 2 ip address A (10.32.11.1) and ip address B (10.32.11.6). i can ping 10.32.11.1 but not 10.32.11.6, i cannot ssh 10.32.11.6 directly but yes i can directly remote ssh to 10.32.11.1 please help mee, what hapen to my network ???

# 3Com Corporation 3c905C-TX/TX-M [Tornado]
DEVICE=eth0
BOOTPROTO=static
BROADCAST=10.32.11.255
HWADDR=00:01:03:41:63:4C
IPADDR=10.32.11.6
NETMASK=255.255.255.0
NETWORK=10.32.11.0
ONBOOT=yes

Reply

8 no route to host August 13, 2009

sir, i cannot run default page in local host. i am using windows 2003 server-OS. can you please help?

Reply

9 Nikhil September 8, 2009

i helped a lot guys,it was mainly due to iptables ,i just flushed it using iptables -F and now no worry..

Reply

10 SSSSSSSe December 14, 2009

Monsieur,I just installed Tor ,when it’s started connecting,stopped and showed (no route to host)….Can u tell me how to work that out,please?thanks…

Reply

11 yogendra athalye February 7, 2010

Thanks a lot. I just cleared the iptables and nfs started working.
thanks a ton……… :)

Reply

12 kanhaiya lal laxkar July 27, 2010

Dear Sir
getting problem with yahoomail acconut errer show certificate errer and
navigation

Reply

13 Saj September 5, 2010

Accept the certificate or change the browser… Simple…:P

Reply

14 tafadzwa September 11, 2010

help please. i recently installed a new cisco router at one of our branches. i am able to ping the head office router and other hosts on the head office lan except the sco unix server. i added a route to the new site in the etc/hosts file but still i cannot telnet or ping the new remote site form the unix server. is there anything i need to do before i get fired

Reply

15 Koushik Das February 22, 2011

Way to go man………………..
It worked

I checked everything except the firewall settings….

With this help I was abe to solve the problem of ftp connection…..

such a small thing but it almost dumbed me

Thanks

Reply

16 New_Linux_User May 31, 2011

Thank you so much, flushing the iptables worked, although of what it means and if it has long-term effects are a mystery to me… All I know is that I can use a SSH between my laptop and desktop, just the way I wanted! Thank you guys for the help, was looking for an entire day on how to find out how to do it. Fedora is pretty cool, but I think Ubuntu is much simpler

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">
What is 2 + 10 ?
Please leave these two fields as-is:
Are you a human being? Solve the simple math so we know that you are a human and not a bot.




Previous post:

Next post: