I want to build a DNS server that people can connect to and when someone goes to “google.com” (an example), I want it to be redirected to my glitch project “example.glitch.me”.
I think what you are talking about would be a DNS Resolver (akin to Google’s 8.8.8.8
or Cloudflare’s 1.1.1.1
) which would not be possible on Glitch to the best of my knowledge (someone please correct me if I’m wrong). You have to connect to a DNS resolver by IP address rather than a domain because it is a DNS resolver which resolves a domain into an IP Address. It would be a catch 22 to have a DNS resolver only accessible via a different DNS resolver.
This is an issue because Glitch projects are hosted inside containers, so several projects share the same IP address and I imagine those IP addresses change as projects get moved from server to server. Glitch abstracts this away from you by redirecting traffic from your *.glitch.me
domain to the proper container inside the proper server that’s currently running your project.
You might be able to use Glitch to host some sort of DNS Name Server but I don’t think that will work for what you are trying to do.
As @FlantasticDan said, this is not possible through Glitch hence the reverse proxy. Another option would be to create a proxy that people can connect to.
You actions are limited with a proxy, you can simply deny people visiting certain websites or redirect to other websites. If the website the person is trying to access is not served under a secured protocol you could also change the content of that website. However if the website is secured using SSL certificate you might run into trouble.