Quickly get all your DHCP info with ipconfig
If you’ve ever needed to troubleshoot a network or internet connection, you know how frustrating it can be (particularly when you’re on techsupport with various broadband providers). This quick tip can make the job a little easier on yourself by retrieving all relevant DHCP information, like DHCP server IP, client, subnet mask, router, DNS servers, everything – directly from the command line.
To get started, launch Terminal and use the command line ipconfig utility.
The command usage for a Mac using Wi-Fi is usually as follows:
ipconfig getpacket en1
The command for a wired network using ethernet is usually:
ipconfig getpacket en0
Whether your Mac uses en0 or en1 depends on the model, but there is no harm in attempting to retrieve the DHCP info from both of them, as only one will return the proper results.
You’ll be presented with a bunch of information, but the most useful of which is usually the DHCP data at the end as seen in the screenshot. I hope this helps you as much as it helped me!