On the iPhone if you go into WiFi settings you can select the ‘i’ on the right end of any network SSID and set ‘Configure DNS’ to ‘Manual’ and then enter your own DNS. This will stick to that SSID only. Very useful when you have a Raspberry Pi at home running pi-hole, but your router settings are locked down.
But there is no way to do this easily on the Mac. Unless - you have Keyboard Maestro! I found this really great setup on StackExchange from @tjluoma
I set it up, then duplicated it and added a new macro that changed the network location to ‘automatic’ when my home SSID disconnects. That way at home (my RV) my Pi w/ pi-hole is always set to be the DNS (using Cloudflare as the upstream DNS), but for any other network (RV park, coffee shop) the DNS is set to Cloudflare (22.214.171.124).
So, I am a very happy camper. Thanks TJ!