Changing a Nameserver

When I originally setup one of my servers I used the same IP for both nameservers because it was easier, but that’s obviously kinda useless. I want to add the second nameserver but I was wondering what is the best way to change the ip of my dns2? When I originally installed Virtualmin I don’t think it asked for the IPs of the nameservers, just the nameservers themselves so I’m a little confused how it’s locally set. And in the original setup it didn’t resolve but I skipped resolving and it worked anyway. Thanks.


If you want to use, say, and as the nameservers for domains on your server… and you’d like to change the IP address for ns2, – you can do that by clicking on “” in the drop-down list on the top-left, then going into Server Configuration -> DNS Records, and changing the IP for the ‘ns2,’ ‘A’ record in there.


Thank you so much! Then changing that IP on my domains records too right?


Well, in theory – what your various domains have listed in them are two ‘NS’ records – and

The IP address for those two nameservers is only defined in one place, that’s in the Virtual Server “”.

So, although all your domains use those two nameservers, the IP should only be setup in one spot.


Sorry I meant on my DNS registrations.

Oh, right… yeah, you’d need to change that IP both in Virtualmin’s “DNS Records” for, as well as at the registrar that hosts


Thanks. So I was just wondering. Before when I typed (my nameserver) it would randomly load one of the sites on the server. Now after changing the IP how you said when I do it it just says:

It works!

This is the default web page for this server.

The web server software is running but no content has been added, yet.

Is my DNS setup right?

Well, I’m making the assumption that the IP you changed that to is running a DNS server that returns the correct IP addresses for all your domains.

What is that IP, is that a separate server? A separate IP on the same server?

One thing you may want to try is going over to, and having it run a DNS report on your domains. It’s possible you do have a DNS issue, and if that’s the case, can help pinpoint what the problem is.


Oh I think I understand why things changed now. Before since all my IPs were the same and I have site on that IP when the dns was typed in it resolved to one of the site on that IP, but my DNS 2 is not use for anything but a nameserver so it doesn’t pull anything up but the default page. Is there anyway to make it so my namservers are not indexed in Google as I noticed my nameserver was in the search results.