Mac does come with "Network Utility" which gives you a GUI interface for common commands such as PING, WHOIS, INFO, NETSTAT,LOOKUP,TRACEROUTE,etc. In older Macs (OS 10 - 10.8), Network Utility is found in Applications/Utilities. In the newer macs, (OS 10.9 and higher), it is found in a different location which is System/Library/CoreServices/Applications.
However, for those that want to be adventurous, here are some terminal commands to use.
For the following commands, en0 is usually ethernet and en1 is wireless.
To display a Mac network interface's IP address (for the wireless network interface, denoted by en1), enter this command:
ipconfig getifaddr en0
To display a Mac network interface's subnet mask, enter this command:
ipconfig getoption en1 subnet_mask
To determine the DNS server a Mac's network interface is set to leverage, enter this command:
ipconfig getoption en1 domain_name_server
To determine the DNS server a Mac's network interface is set to leverage, enter this command:
ipconfig getoption en1 domain_name_server
To determine the router and DHCP information supplied to a Mac's network interface, enter this command:
ipconfig getpacket en1
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article