face-hh / webx

An alternative for the World Wide Web - browse websites such as buss://yippie.rizz made in HTML, CSS and Lua. Custom web browser, custom HTML rendering engine, custom search engine, and more.
Apache License 2.0
1.67k stars 155 forks source link

FEATURE: Sync DNS servers #175

Open 0xnim opened 3 weeks ago

0xnim commented 3 weeks ago

Is your feature request related to a problem? Please describe. The current webxDNS system can only be run by itself.

Describe the solution you'd like There should be a sync between webxDNS servers. The solution that I came up from the top of my head is by having something like Zone files and syncing those from the main server. This would also allow subdomains and other features to be implemented easily.

Describe alternatives you've considered Another solution which is easier but not good for the long term. Just having DNS servers request /domains until they get all of them, and do this every x hrs or something.

Additional context I will likely implement this.

0xnim commented 3 weeks ago

I will get on this probably.

KubaPro010 commented 3 weeks ago

The best and easiest way to do it live would be websockets.

0xnim commented 3 weeks ago

Why do you think websockets would be a good alternative?

0xnim commented 3 weeks ago

This PR Implements it using the alternative way.

0xnim commented 3 weeks ago

And on startup.

KubaPro010 commented 3 weeks ago

Why do you think websockets would be a good alternative?

because they're a full-duplex conection, meaning you can send anything live with them, and if you lose connection then you could go to /domains

0xnim commented 3 weeks ago

The PR i submitted works pretty well

RealPacket commented 2 weeks ago

Why do you think websockets would be a good alternative?

because they're a full-duplex conection, meaning you can send anything live with them, and if you lose connection then you could go to /domains

Yes, so if we have a new domain for a certain DNS server, we could send an event:

{
  "type": "new_domain",
  "info": ...

and if we see that the other DNS server has a new domain, we can copy the domain info from the info property.