No route to host

Hits: 5989  

Often, when we get error “No route to host” to connect remote server via linux command line e.g. wget, curl etc. or web services (webserviceserver).

The first solution we want to try to troubleshot firewalls and proxies?

But before that try hostname entry in linux box…

# vi /etc/hosts
add & save webserviceserver

If still experienced the issue when deploying code from development machine to a live server.

Ping other servers like
# ping
# wget

If ping & wget working for google means the webserviceserver have some block or restrictions to calling servers.

Make sure with several linux network utilities

# nc 8080 [] 8080 (www) : No route to host

# telnet 8080 (working?)

# traceroute (working?)

# ping (working?)

Make sure firewall is not blocking your access:
# /sbin/iptables -L -n
# /etc/init.d/iptables save
# /etc/init.d/iptables stop

# iptables -F
# iptables -X
# iptables -t nat -F
# iptables -t nat -X
# iptables -t mangle -F
# iptables -t mangle -X

Make sure we are using a router and not a proxy server. Proxy servers are good for Internet browsing but not for ftp, sending ICMP request and so on.

Try on alternate port..
# nc 8078

If this is working then we have to use alternate port for the server “”

Make alternate port for network connection 🙂

Published by

Sandeep Verma

I’m an Entrepreneur. I’m proud to work as Blogger, LAMP Programmer, Linux Admin, Web Consultant, Cloud Manager, Apps Developer, Searcher. Concentrate > Observe > Imagine > Launch