Pointing Domain to VPS via Custom Nameservers (multiple domains on VPS)

On my domain registrar I setup gluerecords with my ns1.vps.mydomain.com and ns2.vps.mydomain.com pointing to my VPS IP address.

On my VPS with Virtualmin I set up A records for ns1.vps.mydomain dot com and ns2.vps.mydomain dot com pointing to the VPS ip. I also setup Name Server records for both.

My question is am I missing a step somewhere? Because my DNS records do not seem to be propagating live. I opened up port 53 for tcp and udp on my ufw. But just can not get them to work.

I also plan on hosting multiple domains on the same VPS, is there any additional steps I need to do to not run into issues? Do I need to enter the same nameservers as A and NS records for each new virtual server on the VPS?

I am just confused a bit as my server domain is vps.mydomain dot com but the core domain mydomain dot com will also be hosted on a separate virtualserver as well as 2 other domains unrelated on 2 additional virtual servers.


OS type and version Ubuntu 22.04
Virtualmin version 7.5

What are you using for testing the dns? I use mxtoolbox as I’m use to it. Any service like that should tell you whats going on. port 53 should be open by default on a VM install, do you have a firewall somewhere else?
Each domain you fire up can have its own DNS, so you need to create glues for them at your registrar, is that what you mean?

Depending on who your registrar is, IP addresses are not accepted as nameservers. For instance, GoDaddy will not accept it so it will never work.

Look at your registrars rules to make sure they allow IP’s to be used. A good many of them don’t.

If yours don’t, an external DNS service would be the way to go. I use Cloudflare and it works like a charm.

what are you talking about? dns requires ip addresses. doesn’t work without them…
many registrats even require declaring ip address of the dns server before assigning them to any domain.

is dig mydomain.com @ns1.vps.mydomain.com working as it should?
and what does dig NS mydomain.com show? is it your nameservers nsX.vps.mydomain.com?

(you need to run those from some linux machine (install dnsutils for dig package.))

I must have misunderstood what you were saying.

Most registrars do not allow you to use an IP address in the name server area. If you do it will not work.

Example, Namecheap:

If you enter an IP address in those blanks as a nameserver, it will not work.

I don’t quite get this if you create the ns records in vmin bind so an a record for say ns.ihavenoidea.com then just add ns.ihavenoidea.com at the registar just add ns.ihavenoida.com as the name server does that not work ?

Thanks to everyone who replied but still can not figure this out. My domain registrar is not the issue as I mentioned I have glue records set up there pointing to the newly created name servers and the IP of my VPS.

On my ubuntu 22.04 install I have a UFW firewall, does Virtuakmin also have its own firewall? On the UFW firewall, I opened up all the needed ports I am pretty sure.

This is so frustrating because even though I am new to using Virtualmin and setting up nameservers in Virtualmin I am not new to setting up domain names and DNS and have done it 100s of times over the last 2 decades. Not sure why I am stuck here.

Does the issue have anything to do with me using a subdomain as the name server? vps.mydomain.com?

I got to figure this out in the next few days as when I switched from cloud to VPS my host only gave me a week to get the VPS setup before deleting my cloud account.

When I use dig mydomain.com @ns1.vps.mydomain.com it says failure could not get the address

Could this be my issue? I noticed in Webmin that Bind was not active. When I clicked play in the webmin panel it did not start. When I went into the terminal also could not start it. You can see below my terminal logs.

JJ@webserver:~$ named-checkconf /etc/named.conf
open: /etc/named.conf: file not found
JJ@webserver:~$ systemctl status named
○ named.service - BIND Domain Name Server
Loaded: loaded (/lib/systemd/system/named.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:named(8)
JJ@webserver:~$ systemctl start named
Failed to start named.service: Interactive authentication required.
See system logs and ‘systemctl status named.service’ for details.

Had to use sudo systemctl start named.service to get Bind activated and then after that everything worked like a charm.

You need to make sure it starts on a reboot. I’ve had a rough day and am toast so I can’t take this any further tonight, but don’t forget about this. Always set up a little script to set up server access using keys and the ip address, not the name. If bind goes down again the name won’t help much.

I do not really understand this. Bind does not automatically start on reboot?

I solved my original issue but am having a secondary issue with my name servers.

So my primary domain and sub domain are working fine with the new nameservers. I added a 2nd virtual server with a completely new domain name on the same VPS. Do I just use the same name servers setup previously or do i do the same process again and create glue records, A and NS servers on the new virtual server for the new domain? I tried to do this and I am having issues with the domain not working.

It should. The fact it was down and you had to start it means you might want to double check that it s set to start at startup.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.