Has anyone ever tried to port the installer from Linux to MacOS?
apt to brew
change package names, maybe
syntax of the various tools used
What else?
I'd love to get pi-hole to run natively on my Mac just for myself to see what connects where, how many times, block/allow them. Yes, i can run it in a containers, but i was just wondering if someone tried it to run natively on the Mac.
Regardless of where it's installed, Pi-hole works for all hosts on your network which are using Pi-hole for their DNS. It doesn't need to be installed on a Mac to be able to provide DNS blocking for the Mac.
Since it has a web admin front-end, the stats and data can be controlled from any device with a web browser, and for terminal commands you can ssh to it from any device with a ssh client.
Note that because Pi-hole is a DNS blocker, all it can do is block or allow domain names to be resolved by your Mac. Pi-hole's Query Log will let you see what domains your Mac is requesting and whether they were blocked or allowed.
Pi-hole is not blocking any actual connections here, it's just stopping some domains from being resolved and therefore stopping your Mac from knowing how to reach them.
To detect and block actual connections you need a firewall, either running on your Mac or on your network where the router or gateway is, to act as a gatekeeper based on rules you provide.
For a nice free Mac firewall check out LuLu by Objective-See.
I understand what you are saying, however, that was not the question. I am traveling a lot and having pi-hole on my local laptop would allow me to do all the things i mentioned in my original post.
So yeah, i'm still wondering if i can install pi-hole on my local machines so i have my DNS with me all the time. Without using docker or anything similar. Natively on my Mac.
I've never seen any Mac forks of Pi-hole for native install. If it's possible it sounds needless and non-trivial, as in large rewrites of the code and scripting and modifying macOS's own services to accommodate.
If you have an Intel-based Mac then VirtualBox is a free and very simple way to run a native supported Linux environment and install Pi-hole into it. You'll probably have to set the networking to bridged on the adapter that you'll be using and overrule your DNS assignment and point it there. If you have Apple silicon then VMware Fusion or Parallels will do the same for a price.
However since you have Internet access when travelling, you'll be able to use a VPN to access your own Pi-hole running back home for free. I believe it's possible to send just the DNS traffic through your Pi-hole while using the native connection for everything else (I think I saw that @jfb does this). Guides here for WireGuard or OpenVPN.
I actually carry a small travel router and Pi Zero W. The travel router double NATs an existing WiFi network to a new private LAN, and all my devices (and my wife's if she is with me) connect to the travel router and are on Pi-hole.
For me, this was easier than putting VPN software and credentials on all the devices (laptop, 2 iPads, 2 phones, etc.)
I can also run this in the car, using a phone as the internet source.