You can run your own DNS server locally. I run an unbound server on my router but you can also run dnsmasq on a raspberry pi or something. Pihole uses that. Then you can do whatever you want with local DNS (doesn't help with devices like Chromecast that ignore your local configs, for that you need your own router, which I also recommend. I use pfsense).
You'll need a local webserver running to serve the redirect, but that's a simple nginx config. Maybe I'll write a blog post for this stuff...