Fortunately, Terminal is up to the task, and you can replicate most of the functions and features of Network Utility using the right commands. Here, we’ll list each Network Utility tool and provide an appropriate replacement command.
Using Netstat in Terminal
In Network Utility, netstat provided detailed network statistics. When using Terminal, the output can be quite verbose, so you’ll want to have a goal in mind and use flags to refine your requests.
With the netstat command, you can find information about connections, ports, and other useful details. The basic command on Mac is:
You should, however, aim for a more focused output whenever possible. Some common flags to add are:
-a: Lists all listening ports. -I: Lists packet data for a particular interface. For example, netstat -I en0 will provide information for that interface. -p: Lists details about a particular protocol. For example, netstat -p tcp will provide TCP connection data.
With a specific goal in mind, you may want to customize your commands with additional flags, which you can identify through further research. The following command brings up the netstat manual:
Using the right flag combinations, you should be able to request the information you need.
Ping Terminal Command
As a troubleshooting tool, ping is invaluable. The option in Network Utility helped to diagnose numerous connectivity issues and, fortunately, Terminal replicates the feature well. The basic Terminal command on a Mac is:
For example, to test internet connectivity by pinging an outside domain name, you’ll use a command like this:
Or you can use a domain’s IP address:
To ping another device on your network, such as a router or computer, you’ll need the right IP address. For example, the command to ping your router may look like this:
Sometimes, you’ll want to set the number of pings Terminal sends. Otherwise, the process will continue until you cancel it, which you can do by pressing Control + C at any time. However, to use a preset number, you’ll need to add the -c flag followed by the desired amount, for example:
Using Lookup With Terminal
The Lookup tool in Network Utility allowed you to identify the IP addresses associated with a domain name and vice versa. In Terminal, the nslookup command effectively replicates this feature.
An example Terminal command on a Mac looks like this:
For a reverse lookup, use the IP address of the domain:
Traceroute Terminal Command
Traceroute was another useful Network Utility troubleshooting tool, and Terminal won’t leave you disappointed with its version. The feature works similarly to ping but allows you to track where packets go, where they stop, and where they stall. With this knowledge, you can identify problem areas within your network.
To run a traceroute on your Mac, use the traceroute command along with a destination. An example command looks like this:
From the output, you’ll see the path the packets take to arrive at the target location. When troubleshooting, you can use traceroute between your Mac and any other available device or server.
Whois Terminal Command
The Whois tool in Network Utility allowed you to find information about a domain name owner. Terminal replicates this feature with the whois command, which looks like this:
The output provides detailed information about the person or organization behind the domain name, which can be useful in certain situations.
Using Finger With Terminal
Finger in Network Utility provided information about users on your network, and a simple Terminal command can do the same. The tool, however, is only useful for retrieving local data and won’t achieve much outside of your own network. An example command looks like this:
The information retrieved varies depending on how the network administrator has configured your server and its user accounts.
Port Scan Using Terminal
Network Utility’s Port Scan was a functional and intuitive tool for identifying open ports on your network. The feature is useful for troubleshooting any issues that involve the use of specific ports. For example, if you’re unable to send mail, ensuring the correct port is open may be necessary.
In Terminal, the nc netcat command helps replicate this feature. To make the input work as intended, you should also add -z and -v flags. The first flag, -z, prompts Terminal to scan for open ports, and the second, -v, enables verbose mode.
An example command for pinging a specific port looks like this:
You can also specify a port range, for example:
While not as tidy as Network Utility, Terminal’s port scan function gets the job done.
Terminal Is a Viable Network Utility Replacement
Network Utility may be dead, but the application’s features live on in Terminal. While not as tidy and intuitive as the deprecated diagnostic app, Apple’s command-line interface is a powerful troubleshooting tool.
The netstat command provides detailed information about your network that mimics the old app’s functionality, so you’re not missing anything with the loss of this feature. In addition, ping as a Terminal command performs the same operations as the Network Utility tool, which means, once again, you haven’t lost any functionality here.
With the right command, you can also replicate the Lookup tool in Terminal. Using a domain name performs a standard lookup, and inputting an IP address does the reverse.
Whois works similarly in Terminal, and entering the command with a target domain name provides detailed information about the owner of the property. On top of that, finger is still a useful tool for requesting information about users on your network. The command works similarly to the old Network Utility feature.
While port scan in Terminal isn’t as clean and intuitive as the tool in the deprecated app, you can replicate its functions well with the right commands.
As you can see, we’ve managed to reproduce all of Network Utility’s primary features. Therefore, if you don’t want to clutter your Mac with additional software, Terminal is an effective solution.