Setting up a Nameserver that has a different name than host

Centos 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?

No need to mess with the server’s hostname. Setup your nameservers at the domain registrar where the NS domain is registered. Each NS needs to resolve to your server IP(s). If you have one IP just use the same one for all NS. Next, while at the registrar, replace existing NS for this domain with your custom NS and let it all propagate.

Then do what needs to be done in Virtualmin. You’ll need DNS A records for every nameserver in addition to the hostname A record.

Hi Ramin,
The problem is the last part. How do I create a DNS A record for ns5.domain.com independant of the hostname.
WHen I go to add the DNS A record 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.

If you could please provide instruction on how to do it?

Do I have to create a new server for ns5.domain.com?

Hope I understand better this time.

Is “domain.com” the same for your server hostname and nameservers? If it is, this domain needs its own DNS zone to edit (see Webmin/Servers/BIND DNS Server for a list of zones).

Assuming the server hostname and NS use the same domain like your examples do, the simplest way to achieve this is to create a virtualhost in Virtualmin for that domain. If you’ve done this already edit its DNS Records in Virtualmin.

In Virtualmin with this domain loaded, when you create a new record (green button), for the Record name select the second radio button on the right and you should be able to append NS5 to .domain.com displayed to the right of the form. If you’re seeing the server’s hostname next to this form it seems you are editing the wrong zone. Can’t say for certain without knowing more about your server setup.

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