I initially pointed the registrar of my domain to ns1.dionteq.co and ns2.dionteq.co and added two A records representing the nameservers in virtualmin. I could access the wordpress website I setup on the vps I setup using virtualmin. After about a week I could not access the domain any longer. I then deleted the two nameserver A records and had access again.
Can anyone explain how the registrar knows how to find the nameservers listed with them? I did notice a NS record in DNS settings in virtualmin - NS - Name Server 5-180-180-64.cloud-xip.com.
Read up on “glue” records and “delegation”. You configure delegation at your registrar, usually on a page named “Name Servers” or similar.
Within Virtualmin, if the DNS feature is enabled (which it only needs to be if you’re actually hosting DNS on the Virtualmin server…many people choose to let their registrar host it these days, or use a cloud service like Route 53…we support some cloud DNS providers in Pro) it defaults to adding NS records for the name of the server itself (the FQDN) and whatever additional name servers you added during the installation wizard.
You can always change it in Server Templates in the DNS Domain section. The field is Additional manually configured nameservers and you’d want to uncheck Add nameserver record for this system if you don’t want the automatically added FQDN record.
But, unless/until you delegate the zone to your Virtualmin server and its secondary (you need two servers, if you’ll be hosting your own DNS, we have docs for setting up a slave), there is nothing useful you can do with DNS records on the system itself. The DNS server on your Virtualmin server can’t do anything useful if authority for the zone has not been delegated to it by your registrar.
And, how you delegate at your registrar is out of our control and not our area of expertise…you’ll have to check the docs at the registrar. NameCheap is what I use, and I believe they call it just “Name Servers”, but it’s a little tricky in that I think the name servers have to already exist as names to be able to delegate to them. So springing a new domain into existence and delegating to name servers within that zone can be tricky. You pretty much have to start on the registrars DNS servers until you establish the existence of the new name servers in your zone, and then delegate to them.