On macOS, you might be able to use /etc/resolver to fix this:
sudo sh -c 'echo "nameserver 192.168.1.1" > /etc/resolver/captive.apple.com'
I did this for an internal website at my university that could only be resolved using the network name server. It just occurred to me that it might also work for the URL macOS uses to detect captive portals. We'll have to see if it works the next time I'm at a café.
This would be cool as a menu bar application that shows up when it detects an external display, sort of like a rear-view mirror for my Mac. I wonder if it would be possible to move things around inside it with the accessibility APIs that window managers use.