Helping to share the web since 1996


Linux Commands for New Users for resolving network issues effectively.

a computer screen with a lot of data on it

Modern network connectivity has advanced significantly from its earlier days. Although it’s far more reliable than it was in the 1990s, problems can still arise. Fortunately, Linux offers a variety of commands that can be used to troubleshoot these issues effectively.

Key Linux Commands for New Users

Here are the first five commands I turn to when troubleshooting network problems.

  1. ip The ip command is not only useful for finding your computer’s IP address (simply use ip a), but it also helps in diagnosing connectivity issues. For instance, to check the status of all network devices, you can use:
bashCopy codeip link

This command displays the names of your network devices, MTU speed, configuration options, and the IPv6 address. You can also bring network devices up or down with:

bashCopy codesudo ip link set wlp15s0 down
sudo ip link set wlp15s0 up

To view the routes defined on your machine, use:

bashCopy codeip route

This will show the default route, applied configurations, and the network’s subnet.

  1. nslookup The nslookup command is essential for troubleshooting DNS name resolution issues. If you’re having trouble accessing a site and need to determine if it’s a local or remote issue, you can start with:
bashCopy codenslookup zdnet.com

If you receive a response that includes the site’s IP address, the issue is likely local. If there’s no response, the problem is remote, and you’ll need to wait for the site to become available again. You can also perform a reverse DNS lookup with:

bashCopy codenslookup IP

Replace “IP” with the actual IP address to find the associated host.

  1. ss The ss command has replaced the deprecated netstat package and provides detailed information about your computer’s network connections. By default, running ss without options lists all non-listening sockets with established connections, showing which devices are connected to your computer. This can help identify problematic connections. For instance, to list connections to a specific IP address, use:
bashCopy codess -a dst IP

Replace “IP” with the target IP address. The output includes network ID, state, received and sent packets, local and peer address ports, and the process.

  1. tracepath The tracepath command reveals the network path between your local machine and a remote host, listing all routers along the way. To troubleshoot connectivity issues, you can use:
bashCopy codetracepath SITE

Replace “SITE” with the domain or IP address. The command shows all hops between your local machine and the remote host, helping to pinpoint where the connection problem might be. The maximum number of hops is 30 by default, but you can adjust it with:

bashCopy codetracepath -m 50 SITE

Replace “SITE” with the target site. Although checking 50 hops is usually unnecessary, it’s an available option.

  1. ping The ping command is often the first tool I use for network troubleshooting. If I suspect a network issue, I run:
bashCopy codeping google.com

If this command works, the issue is not DNS-related. The ping command is useful for checking the status of your local network or verifying if a specific site is down. A response indicates that the problem lies elsewhere.

These five Linux commands are crucial for diagnosing and resolving network issues effectively.

Newer Articles

Older Articles

Back to news headlines