Creating my own nameserver

8 posts / 0 new
Last post
#1 Fri, 06/10/2011 - 04:51
adamsargant

Creating my own nameserver

Hi... I wonder if anyone can help me... I've spent a couple of days researching this but can't quite make sense of it all... I'm in the process of migrating from a brief dalliance with Plesk to Virtualmin and I'm trying to configure the DNS on my dedicated server (Centos 5.6) in a specific way to match what I had with the Plesk set up.

Basically, I want to run my own nameserver so that all the domains on my server can be pointed to with that one nameserver. So for the sake of argument, I want to set the nameservers up to be ns1.mynameserver.net and ns2.mynameserver.net and then any domain I host can be set to point to those and those alone.

In plesk, I set the hostname to mynameserver.net and set up the domain mynameserver.net to include the following DNS records (having set the GLUE records for ns1.mynameserver.net and ns2.mynameserver.net)

mynameserver.net. NS ns1.mynameserver.net.

mynameserver.net. NS ns2.mynameserver.net.

ns1.mynameserver.net. A ip1

ns2.mynameserver.net. A ip2

and then set the DNS records for any subsequent domain added to the server to include

newdomain.com. NS ns1.mynameserver.net.

newdomain.com. NS ns2.mynameserver.net.

newdomain.com. A ip1

This configuration seemed to work fine for Plesk (with a few warnings in DNS analysis services but no glaring errors). However, when I run a test on mynameserver.net or newdomain.com at http://www.intodns.com/ on my Virtualmin controlled server I come back with the following error

SOA MNAME entry WARNING: SOA MNAME (mynameserver.net) is not listed as a primary nameserver at your parent nameserver!

I do struggle a bit with this resolution lark, though I'm slowly getting there... but could anyone tell me if I'm missing something here and help me speed my learning up? :-)

Fri, 06/10/2011 - 05:03
Locutus

Some quick first pointers:

Unlike in Plesk, it is customary in Virtualmin that the domain name of the server itself is not managed through Virtualmin, but is either externally resolvable (i.e. you use a hostname/domain that your hoster has assigned to you), or which is served from a zone that is managed directly in Webmin (in which case you need to tell the registrar of the server zone that its nameserver can be found on your IP).

The warning you get sounds like the name of your server is not entered at the registrar.

Before you do further steps, you should decide whether you wish an external hostname or a Webmin-BIND-managed zone for your server's domain.

Fri, 06/10/2011 - 05:46
adamsargant

Edited to add: OK, your answer now makes a little more sense to me as I've looked into the webmin panel, found IP addresses that aren't mine, looked them up and they are managed by the people I rent my dedicated server off... so the suggestion is, I take it, that I can use their nameservers in exactly the same way as i used to use my own on plesk, without having to set my own up on the server. Thank you... I hate asking but your pointers are proving invaluable to furthering my understanding <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Thanks for the reply Locutus. I have a few sites that I host for other people (all voluntary/non-profit stuff that I don't make money for) on my plesk server that I will want to move across to my new one (I am disliking plesk :-) ) and these sites are domains registered with various different registrars that I don't necessarily have access to... on the whole it has proved easier to run my own nameserver as I have done in the past and just ask them to update their nameserver settings with their registrar to ns1.mynameserver.net and ns2.mynameserver.net) without going into too much detail, I set some of them up with Google Apps for email for example, so full control of the DNS records is useful... and it is generally easier to tell them where to enter the nameserver values :-) So my inclination is to stick with a Webmin-BIND-managed zone for my server's domain.

mynameserver.net is registered at my registrar and has its nameserver set there to point to ns1.mynameserver.net and ns2.mynameserver.net and has its glue records set to the relevant IP addresses

Fri, 06/10/2011 - 05:50
Locutus

For now, I was only talking about the zone that holds the A records for your new server itself, not the zones you're hosting for your friends. :) The latter you can (and should - that's what makes life easier) manage through Virtualmin which does all the required BIND setup for you.

The server's zone itself though should not be Virtualmin-managed. If you already have the registrar in that regard set up with ns1/2.mynameserver.net and have correct glue records in place (the fact that you know that term shows that you obviously know your way around DNS ;) ), you can set up the zone in Webmin's BIND module and should be set.

Once that is done, you should be able to have the hosted domains point to ns1/2... like before.

Try that out, and let me know if you get it to work. If not, feel free to ask, and it'd be best then to post the actual domain names and IPs involved, so I can do some diging of my own. :)

Fri, 06/10/2011 - 07:03
adamsargant

so should I delete the domain mynameserver.net in Virtualmin before creating a new zone with that name in Webmin?

The actual domain I am using for the nameserver is sargant-server3.net (so I have set the glue records ns1.sargant-server3.net and ns2.sargant-server3.net to point to the IPs 217.174.248.54 and 217.174.249.158 respectively... the domain I'm initially trying to host is yorkpeacefestival.org.uk, and I don't have access to the registrars DNS records management for this, but the guy who does has set up the Nameservers to point to ns1.sargant-server3.net and ns2.sargant-server3.net... it all kinda works but I don't like kinda, and it's propagation is bouncing madly back and forth between the new location and the old which makes me suspect that it doesn't like the DNS set up). I have a test domain bunnyslaw.net (don't ask!) which seems stable, but I know in the past when I had problems setting up the plesk server this is no indication that I have anything right :-)

Fri, 06/10/2011 - 07:41
andreychek

Howdy,

Well, the hostname of the server shouldn't be a Virtual Server in Virtualmin... but it's otherwise okay if it's managed via Virtualmin (ie, if your server is named "host.example.com", you can go into the example.com Virtual Server, and make a DNS "A" record entry for "host.example.com" -- but you don't want to have a Virtual Server named "host.example.com", or strange things can happen).

There's a entry in the document here titled "How do I setup nameservers for my server?", that may help answer some of your nameserver questions:

http://www.virtualmin.com/documentation/dns/faq

However, it sounds like you have it mostly working.

For your domain "yorkpeacefestival.org.uk" -- is it possible that an old DNS record is cached in your ISP? I seem to consistently get "217.174.248.54" as the IP address for it.

-Eric

Fri, 06/10/2011 - 08:11
adamsargant

Howdy Eric and thanks... OK.. looking at the faq that is how I've set things up... BUT... my hostname is sargant-server3.net AND I have the domain sargant-server3.net set up in Virtualmin (I've done things like this in the past so that I can access server wide services such as phpmyadmin under the sargant-server3.net domain... only because it kind of makes sense in my head :-) Are you saying I should change the hostname so that it is something like host.sargant-server3.net ??

Fri, 06/10/2011 - 08:27
Locutus

It is sure possible to use a second-level name (somename.net) as a server host name, though a bit unusual. Normally you have a separate "hostname" and "local domain name" configured.

The hostname (a single word without dots) goes into /etc/hostname, and the domain name into /etc/hosts and /etc/resolv.conf. Example for my experimental virtual server:

/etc/hostname:

lyra

/etc/hosts

127.0.0.1       localhost
188.40.20.89    lyra.tianet.de  lyra

/etc/resolv.conf

nameserver 127.0.0.1
nameserver 188.40.20.81
domain tianet.de

188.40.20.81 is the router in this case, which forwards nameserver requests to the hoster.

This way, the FQDN of the host, which hostname -f displays, is lyra.tianet.de. I created the "administrative domain" tianet.de in which all my hosts and other service names like ns1.tianet.de are located.

Tianet.de is not managed through Virtualmin, but I have a BIND zone, configured via Webmin, for it on one of my servers. The registrar is configured to point the NS entries to that server.

I found that doing this is the most reliable way to avoid problems with "resolvability" of the administrative host names. :)

Topic locked