How to create Nameserver with a name that is different than hostname

Cemtos 8
OK. I am setting up the new virtualmin server but I am having an issue setting up a nameserver on the same machine.

The hostname for the server is server04.domain.com.

If I following the directions here: DNS Frequently Asked Questions | Virtualmin I go to Server Configuration -> DNS Records, and create a new “A - IPv4 Address”
When I do, under record name I have the option of Same as domain or .server04.domain.com. If I choose the first the new record is like it says, the same as the domain (server04.domain.com) if I choose the second the nameserver record will be ns5. server04.domain.com.

Is there any way to have a nameserver on this box that is simply ns5.domain.com? To me it looks like I would have to change the hostname to ns5.domain.com. This is not ideal. Does anyone know how to accomplish this? Do I have to create a new Virtualmin server called ns5.domain.com?

I know it will throw an error if the nameserver name hasn’t been registered or is registered to a different IP; but as far as I know, it will still accept the entry.

I just created one named “bobby.” Virtualmin voiced its objections, but still recorded the entry.

As an aside, some of my nameserver pairs over the years:

bonnie and clyde
joshua and caleb
sacco and vanzetti
sonny and cher

Now I’m old and boring. I just use NS1 and NS2.

Richard

1 Like

Hi RJM_Web_desing,
Sorry. I am not sure if I understand. Are you saying I need to create a new Virtual server for the Nameserver Like ns6.domain.com

No, not at all. But if you haven’t registered the nameserver names with the registrar holding the domain registration (or if they’re registered to different IP’s), Virtualmin will tell you about it. But it will still make the entries in BIND.

It’s not unusual for nameservers to be incorrect temporarily. Lots of hosts migrate accounts to new servers and re-point the same nameservers to the new IP’s when they’re finished with the migration. That’s to prevent the clients from having to change their domain namesevers with their own registrars, which invariably triggers tickets from the… let’s just say “challenged” clients.

Richard

Sorry RJM - I meant ns5.domain.com not ns6.

So this Virtualmin server is new. Domain.com is hosted on a cPanel server as well as NS1-NS4.
I have already registered ns5.domain.com at the registrar using the IP for the new Virtualmin server.
In order to follow along with the documentation here: DNS Frequently Asked Questions | Virtualmin
Where it says:

“you’ll want to log into Virtualmin, select your “example.com” domain, click Server Configuration -> DNS Records, and create a new “A - IPv4 Address” record for ns1.example.com and ns2.example.com.”

The problem is example.com (or in our discussion it is domain.com) is already hosted on the cPanel server. To get inline with the documentation I added domain.com to the new Virtualmin server, and then followed the rest of the documentation.
Is there a way to add the nameservers without having domain.com set up on the virtualmin server? Or does the domain.com on Virtualmin need to match the record on the cPanel server.

I am so sorry I am not getting this.

Ah, okay. That’s clearer.

I’m sure you can do this; but everything that follows is something I’ve never actually done in your exact situation. So it could be wrong advice. Wait for verification from someone who’s actually done it.

What I personally would do would be give the new server a unique hostname on the same domain as the old one. So if the old one were server1.domain.tld, I might name the new one server2.domain.tld.

What I did next would depend on whether I intended to keep the old server in service or not. If so, I would create two new nameservers on the new server, for example, NS3.domain.tld and NS4.domain.tld , and register them with the registrar for domain.tld. That’s assuming that the old server was using NS1 and NS2. The important thing is that the new ones be unique.

I would also create entries in BIND on the old server pointing to the IP’s for server2, NS3, and NS4 on the new server. The old server remains authoritative for the domain. New accounts on the new server would have their nameservers pointed to the new ones on the new server, which would become authoritative for those new domains.

Now… if my intention were to decommission the old server, I would first shorten the TTLs on the old server to something absurdly short, like 300 or 600.

I would then create the identical nameservers on the new server as those on the old ones, but not register the change just yet. Virtualmin will complain, but will make the entries.

Next I would migrate all the sites and check to make sure everything was in order. Once certain of that, I would…

  1. Register the IP changes for the nameservers at domain.tld's registrar.
  2. Change the entries for the nameservers and all of the migrated domains, on the old server, to point to the IP’s on the new server.
  3. Wait until the old server hasn’t received any traffic for a few days, and decommission it.

In this way, no changes need to be made to the nameservers for the migrated domains. The IP’s for the nameservers themselves will have been changed, so there will be no need.

The old server’s role during the transition is reduced to a traffic cop, pointing any traffic that arrives during propagation or due to client-side caching to the new server. Typically it takes a few days to a few weeks for the server to no longer receive any traffic.That’s the point of shortening the TTL’s (“time to live”). It instructs connecting clients to query DNS if more than that many seconds have elapsed since their last connection. It’s useful for reducing client-side caching problems and speeding up propagation.

Again, I’ve never done this from cPanel > Virtualmin, so it’s very possible I’m missing something. When I did it, the migration was to a server with an entirely different FQDN from the old one; and because I owned all the domains to be migrated, I just batch-changed their nameservers at my registrar.

If they were client sites, I would have re-created the new server with the same FQDN and nameservers as the losing one; and with any luck, the clients wouldn’t have even noticed the change.

Richard

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