What is the proper way to setup two dns servers

hello guys,
i have my domain setup and pointing to two VMs ns1. and ns2. each running on its own ubuntu VM.
now i want to use two or more servers for redundancy of the registration-server-docker, running each installation on each VM will ended with two DBs for registered names for pagekite. and sometime the requests may not even finish as the tokens might exists in one server and not the other… so my question is how do i create two or more registration-gateway servers where they can stay synced…?

thanks guys.

What we do is use a MySQL database that is accessible by both servers. PostgreSQL is also supported.

so i should run the registration-server docker image on each server and point both to a single DB and update the config.toml to point to the same DB?

what version of MySQL to use as i’m getting the following error:
Failed with: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'PRAGMA foreign_keys = ON;
Edit: i’m an idiot, i just realized that i had to rebuild the docker image with the proper DB setting. sorry about this…

Yes, that’s correct.