In this tutorial, we will be showing you a couple of ways that you can use to find your IP address on a Mac.
There are two types of IP addresses that your Mac will get assigned. One is a private IP address used to locate you within the current local network.
The other type of IP address, a public IP, is used to identify your home network on the world wide web.
Within the following sections, we will be showing you how to find both the public and private IP addresses of your Mac.
Finding the Private IP Address of your Mac
Let us start this guide by showing you how you can find the private IP address of a Mac. Knowing this IP address will allow you to reach your Mac from other devices on the same network.
There are two ways that you can use to find the IP address on a Mac. One is to find it through the desktop interface. The other is to use a simple command through the terminal.
Please note that unless you make your Mac’s IP address a static one, there is a chance you get assigned a different IP every time your device reconnects to the network.
Using the Desktop Interface to get the Mac IP Address
Finding the private IP address of your Mac is a relatively straightforward process. All we need to do is navigate to the “Network
” options page.
1. Start by clicking the Apple icon in the top-left corner of the screen.
2. With the menu that pops up, you will want to select the “System settings...
” option.
3. Now that we have the system settings open on our Mac, you will need to change to the “Network
” tab (1.).
Once on the “Network
” tab, tab, select the network adapter (2.) from which you want to get your Mac’s private IP address.
4. With the network settings page now open and your adapter selected you will want to click the “Details...
” button next to the connection.
5. Finally, you can see the private IP address assigned to your Mac by looking next to the “IP address
” label, as shown below.
Using the Terminal
If you prefer, you can easily find the private IP address on your Mac by using the terminal. If you are comfortable using the terminal, this can be a much quicker process.
1. The easiest way to open the terminal on your Mac is to use Spotlight. First, open Spotlight by pressing COMMAND + SPACEBAR on your keyboard.
With Spotlight open, type in “terminal
“, then press the ENTER key.
2. Now that you have the terminal open, you can find the private IP address of your Mac by using the following command.
The ipconfig command allows us to get various details about our network devices including the IP addresses assigned to them.
By using the “getifaddr
” option, we can specify a specific interface from which to get the IP address.
In our case, we are using “en0
“, but if you have a Mac such as a Mac Mini with both ethernet and Wi-Fi you may want to try using “en1
” instead if the provided IP is incorrect.
ipconfig getifaddr en0
3. After running the above command, you should get the private IP address of your Mac device. For example, our devices IP address was the following.
192.168.0.93
How to find the Public IP Address on your Mac
The other type of IP address that you may want to find on your Mac is your public IP Address. This address is how your network is located outside of your local network.
In a typical network using IPv4, your router is assigned a specific IP address from your internet service provider. Therefore, you must use port forwarding if someone wants to connect to your Mac on this network.
From the Desktop
The easiest way to check your public IP address when using the desktop interface is to use your web browser.
Google for example will show you your public IP whenever you search for the text “What is my ip
“. There are also various websites that can show both your IPv4 and IPv6 addresses at the same time.
1. Within your favourite web browser, all you need to do to find your Mac’s public IP address is go to Google and search for “What is my ip
“.
Below you can see how Google will respond with the public IP address of your Mac device. In our example, you can see that we are connecting over IPv6.
By using the Terminal
Getting the public IP address from your Mac is an easy process. All we need to do is use the dig command to make a request to a DNS server, such as Google’s, that will return our IP address.
1. Before continuing, you will need to open the terminal on your Mac device.
One of the easiest ways to open the terminal is to use spotlight. Open Spotlight on your Mac by pressing COMMAND + SPACEBAR.
With Spotlight open, type in “terminal
“, then press the ENTER key to open the command line.
2. With the terminal open, you only need to use the following command to retrieve the public IP address.
This command uses the “dig
” application to make a DNS request to “ns1.google.com
” with “o-o.myaddr.1.google.com
“. This DNS server is programmed to respond with the connecting IP address.
dig -4 TXT +short o-o.myaddr.l.google.com @ns1.google.com
3. After running the above command you should see that your public IP address has been printed into the command line as shown below.
We have used the letter “X
” to hide our own public IP but you should get an idea of what this command returns.
"206.XXX.XXX.XXX"
Conclusion
At this point in our tutorial, you should now have a good understanding of how you can find the IP address on a Mac.
Please comment below if you have encountered issues getting public or private IP addresses.
If you found this tutorial useful be sure to check out our many other Mac tutorials.