#1: Use ping command


Always ping the IP address of server and then try hostname. For example:


$ ping 75.126.43.232
$ ping cyberciti.biz


If you can ping by IP address but not by hostname, then make sure you have correct DNS name servers setup in /etc/resolv.conf file.


$ less /etc/resolv.conf
Output:

nameserver 192.168.1.10
nameserver 208.67.222.222
nameserver 208.67.220.220

#2: Use traceroute command


If you cannot ping your server at all, use traceroute to trace network problem. traceroute provides the detailed information about path to a network server. You can always find out if server is down from your own workstation or gateway router.
$ traceroute cyberciti.biz


#3: Look for default route / gateway IP


If traceroute point out that you cannot reach to your own gateway, then check routing setting on your own workstation. Add default route.
# route
# route add default gw 192.168.1.254 eth0


#4: Look for IP address


Make sure you have correct IP address assigned by DHCP server. Some time network admin make changes to DHCP server or changes IP routing or other stuff. It is a good idea to restart network interface:
# /etc/init.d/network restart
# tail -f /var/log/message
# ifconfig -a
# route


#5: Check for network cables and power supply


Make sure the network cable is plugged into interface as well as into network switch/hub. It is possible that someone may have pulled out network cable from switch/workstation.


#6: Check firewall log


Make sure your own firewall is not blocking access to remote server. Just try to stop your firewall.
# iptables -L -n
# tail -f /var/log/messages
# /etc/init.d/iptables stop


If you are using Cisco PIX or dedicated Linux / OpenBSD box as firewall, check logs for more information.


#7: Connect to correct ports


Most service connects to default port such as


HTTP - port 80
Proxy - port 3128
SSH - port 22
FTP - port 21


Sometime you change default ports to increase security, so make sure you are connecting to correct remote port.