Networking 101 : Basic network troubleshooting -inaccessible servers or hosts-
When we can't reach a server, we try to ping it using the below:
If the IP address "ping" is successful, we would know that we have a name resolution issue and we check the below files.
/etc/hosts:
We check the "/etc/hosts" to see if the name of the host and its IP address are in the file.
/etc/resolv.conf:
We can also check the "/etc/resolv.conf" to see if the we have the right DNS server IP address:
The "search" option allows us to use "short" names for the hosts.
Example:
We can use the below command to "ssh" to "site.company.com":
The system will add "company.com". It will be as if we have typed the whole name of the host:
/etc/nsswitch.conf:
We check also the "/etc/nsswitch.conf" that tells the system the order in which these files (/etc/hosts, /etc/resolv.conf) should be checked to resolve the name of a host (in the example below the order is : file then dns):
dns : checks the list of DNS servers to consult in "/etc/resolv.conf"
IP address not reachabe:
If the IP address is not reachable either, we use the below command to check the network interface to see if its active and that it has the right IP address:
The default gateway:
We check that the packets can reach the default gateway and we ping the it.
We can get the IP address of the default gateway using the below command:
Routing table:
We would also need to check if the entries in the routing table are accurate. We can display the routing table using the below command
to check if our gateway is in the routing table and that it is set correctly.
to check if our gateway is in the routing table and that it is set correctly.
Comments