For macOS and iOS, you can create a profile to configure which DNS server you want to use at all times (including across different Wi-Fi networks and mobile data). See:
That’s what I’ve been using for years and never had any issues with public hotspots.