List a Macs Local IP Address History Over Time or from Specific Dates
If you ever find yourself needing to know a history of a specific Macs assigned local IP addresses, you can find this potentially helpful networking information from the command line. This trick will report all local IP addresses which have been used by a Mac, and, very helpfully, it will also offer the specific date and time a given IP address was assigned to the Mac. Yes, this data spans networks and applies even if it’s no longer the active IP of the machine.
If you’re wondering why this may be helpful, IP address history can be invaluable for network troubleshooting purposes like the annoying same IP error, systems and network administration, digital forensics, and likely other tasks as well.
Get a List of Local IP Addresses Assigned to a Mac
The following command will get a complete list of all locally assigned IP addresses on a given Mac:
cat /var/log/wifi.log |grep "Local IP" |less
An example of such output would look something like this, keep in mind the output can be extremely long depending on the size of the wifi.log file and the age of the Mac, thus piping the results through less or more for an easier read. If you want the full history dumped to the command line, leave out the last pipe “|less”:
Sat Jul 4 15:23:00.296
Sat Jul 4 16:24:05.694
Sat Jul 4 16:45:32.476
Sat Jul 4 20:22:31.770
Sun Jul 5 10:38:38.518
Sun Jul 5 20:21:48.599
Mon Jul 6 02:28:09.715
Mon Jul 6 02:43:17.257
Mon Jul 6 04:56:42.701
Mon Jul 6 05:11:46.536
Mon Jul 6 16:59:42.216
Mon Jul 6 19:11:29.563
Mon Jul 6 19:59:55.667
Mon Jul 6 22:11:50.543
Mon Jul 6 22:26:56.589
Tue Jul 7 00:38:51.855
Tue Jul 7 00:53:55.393
Tue Jul 7 21:04:15.704
Tue Jul 7 22:05:00.573
Tue Jul 7 22:06:15.692
Tue Jul 7 23:07:00.554
Tue Jul 7 23:08:15.577
Wed Jul 8 00:27:41.617
Wed Jul 8 02:16:26.556
Wed Jul 8 02:17:41.587
Wed Jul 8 04:06:26.555
Wed Jul 8 04:07:41.605
Wed Jul 8 05:56:26.566
Wed Jul 8 05:57:40.226
Wed Jul 8 07:01:33.566
Wed Jul 8 08:17:18.563
Wed Jul 8 10:59:16.586
Wed Jul 8 11:34:45.866
Wed Jul 8 20:52:50.550
Wed Jul 8 22:19:41.216
Wed Jul 8 22:22:06.838
Wed Jul 8 22:24:44.172
Wed Jul 8 22:27:09.892
Wed Jul 8 22:29:37.016
Wed Jul 8 22:31:21.625
Wed Jul 8 23:31:32.612
Wed Jul 8 23:33:58.271
Wed Jul 8 23:36:24.034
Wed Jul 8 23:38:08.778
Thu Jul 9 01:22:14.939
Thu Jul 9 01:24:40.627
Sun Jul 12 00:51:33.181
Sun Jul 12 02:40:18.606
Sun Jul 12 04:11:02.478
Sun Jul 12 05:59:47.615
Sun Jul 12 07:00:48.608
Sun Jul 12 08:01:33.610
Sun Jul 12 09:02:18.613
Sun Jul 12 09:18:30.315
Sun Jul 12 10:41:23.334
Sun Jul 12 11:42:08.615
Sun Jul 12 17:18:43.755
Sun Jul 12 18:58:09.198
Sun Jul 12 20:02:17.617
Sun Jul 12 21:30:15.170
Sun Jul 12 23:01:01.241
Sun Jul 12 23:51:46.368
Mon Jul 13 00:52:31.643
Mon Jul 13 02:41:16.616
Mon Jul 13 04:12:01.890
Mon Jul 13 05:57:46.613
Mon Jul 13 07:00:52.609
Tue Jul 14 16:19:32.460
Tue Jul 14 17:20:17.612
Tue Jul 14 18:21:02.613
Tue Jul 14 19:21:47.610
Tue Jul 14 20:01:53.611
Tue Jul 14 21:32:38.610
Tue Jul 14 22:03:23.452
Tue Jul 14 22:35:51.691
Tue Jul 14 23:06:56.536
Wed Jul 15 00:52:40.897
Wed Jul 15 02:41:24.535
Wed Jul 15 04:12:09.169
Wed Jul 15 05:57:54.613
Wed Jul 15 07:01:51.680
Wed Jul 15 08:02:35.502
Wed Jul 15 09:03:20.606
Wed Jul 15 10:11:26.677
Wed Jul 15 12:25:08.484
Wed Jul 15 15:09:38.001
Thu Jul 16 04:11:13.624
Thu Jul 16 05:59:58.628
Thu Jul 16 07:01:45.087
Thu Jul 16 08:02:30.605
Thu Jul 16 09:03:15.618
Thu Jul 16 10:04:31.065
Thu Jul 16 12:44:06.798
Thu Jul 16 16:10:53.498
Thu Jul 16 17:39:54.537
This is obviously quite a bit of data, which is why it’s piped through less, or you can redirect it to a text file if you’d like to review it elsewhere.
Finding a Macs IP Address for Specific Date or Time
Another option is to search specifically for local assigned IP addresses used on a given date. The format used for this is YYY ZZZ XX, where YYY is the first three letters of the day, ZZZ is the first three letters of the month, and XX is the numerical date. For example:
cat /var/log/wifi.log |grep "Local IP" |grep "Thu Jul 23"
This would report back entries that match that date only:
$ cat /var/log/wifi.log |grep "Local IP" |grep "Thu Jul 23"
Thu Jul 23 00:07:53.688
Thu Jul 23 01:56:38.622
Thu Jul 23 02:23:07.227
Thu Jul 23 04:11:52.817
Thu Jul 23 06:00:37.623
Thu Jul 23 07:01:21.625
Thu Jul 23 08:50:06.748
If desired, you could get even more specific and search for times of day when an IP address was assigned, if you’re going to grep for that, remember to use 24 hour time, and account for the time information being determined by the local machine time zone settings.
Going further for discovery or troubleshooting, you could compare the data found within wifi.log to a history of connected wi-fi networks to uncover further details, or to remedy an IP issue with a specific router.
It’s worth noting that some modern versions of MacOS do not include local IP information in wifi.log, but earlier versions of MacOS and Mac OS X do, so if you are scanning the log files and do not find the information you’re looking for, consider which version of MacOS is in use.
If you know of any other helpful tricks pertaining to local IP address history for a specific machine, let us know in the comments.
The cat in this example is useless, it does the same thing grep does.
cat /var/log/wifi.log |grep “Local IP” |less
Should instead be simply
grep “Local IP” /var/log/wifi.log|less
Thanks for this info about the Wi-Fi log file, of which I was previously unaware.
I realize that the main impetus of your article is about that file, not the intricacies of the commands used to garner data from that file. I thought that some might like to see those commands in a shorter form, noting that there are other situations in which a cat command or multiple greps might be required.
grep “Local IP” /var/log/wifi.log |less
grep “Thu Jul 23.*Local IP” /var/log/wifi.log
The title of this article should be updated to reflect that this only applies to WiFi addresses.