beginner dns/nameserver question

dmacleo

Active Member
Jan 28, 2012
44
0
56
cPanel Access Level
Root Administrator
pretty sure I have messed up setting this up.
first of all, is it best for the vps machine name to be unrelated to any domains that may be hosted on it?
if I had thought of it I easily could have done that and pointed my custom dns to the vps.

next question is using the vps as the NS for hosted domains (which will all be mine and I have access to registrar for) and how to set that up. should I use the shared ip of the vps for one NS entry and another for a second? this is what I have now with the only hosted domain on another dedicated ip.
of should the vps, NS1 and NS2 each be unique.

I notice no subdomains ever work and I know I had setup issues with dns earlier so I was wondering if the above would contribute.
 

Infopro

Well-Known Member
May 20, 2003
17,091
516
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
You could if you wanted, have a domain be the server name and an account / website yes. I've always done this myself.
Setup the server properly first with servername.domain.com then add the first package, and then account domain.com

I also use that same domain for the nameservers as well. You'd want to use 2 IPs of course (but you can get away with one).

Lets say I have two IPs on the new VPS, I setup the server here:
WHM > Server Configuration > Basic cPanel & WHM Setup, Basic Config tab including adding my nameservers as I wish, assign IPs and add an A entry.

Next go to my domain name registrar for example godaddy, and setup the nameservers for my domain.

In this example they could be ns.domain.com and ns1.domain.com


Can't answer on the sub domain issue. No need really, you need to get the basics going first then the rest should come together.
 

dmacleo

Active Member
Jan 28, 2012
44
0
56
cPanel Access Level
Root Administrator
I have not tried this yet but am willing since I have had some niggling odd little dns issues and I have enough ip's.

from what I have read, and what I am thinking of doing if it seems "correct" is to name the vps vps.mydomain.com, load whm in it and assign 2 ip (NOT using the vps ip ?? ) as ns1/2.mydomain.com
then I would create a dns zone for mydomain.com (no sites for that domain would be hosted there) in dns editor.
then for the only important account I'll be hosting I'll just add it (has dedicated ip due to ssl) and make sure the registrar is pointing to the ns1/2 ips.

just been small little issues I cannot nail down and since i am using vps to learn with (boy its nice to reinstall an o/s in 2 minutes LOL ) before I move to dedicated I want to try to get stuff nailed down.

that sound plausible or overkill?
thank you.
 

Infopro

Well-Known Member
May 20, 2003
17,091
516
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
Well, you'd install cPanel, and then name the server, not the other way around. You do not need to use the main IPs for nameservers if thats what you're asking, no. Say you had 3 IPs, 1 for mian shared IP, 2 more for nameservers, should work fine.

I think you've got it covered, and since you've got a server to play on and learn you can't go wrong. Once everything is setup as it should be, make sure to leave propagation time added into your equation. If something does not work right away, it might actually work, just not ready to (propagation can take minutes to days) go yet.

HTH!
 

dmacleo

Active Member
Jan 28, 2012
44
0
56
cPanel Access Level
Root Administrator
hmm, whm/cpanel was pulling vps name for machine name so I just left it, never really thought I could use different there.
learn something every day...now remembering it is the issue :)
one benefit of using different domain name I own is I already created the vps/ns1/ns2 entries and pointed them, by the time I screw up courage to start over again they'll be propagated LOL most entries point to my windows SBS2011 server but those 3...just gotta remember vps isn't the exchange server LOL

the domain-site running off vps already has one of the ns entries working too.

think I will try it, while may be a bit more setup initially if I ever do want to host a friends domain I think it would go easier.

and yes it helped, I thank you for taking the time :)
 

dmacleo

Active Member
Jan 28, 2012
44
0
56
cPanel Access Level
Root Administrator
just wanted to update in case it helps anyone, I had to change plan slightly but the basic premise was smooth. I actually registered a domain specifically for the server.

the following is what I posted elsewhere, posting here in case it helps:

First this is not going to go through the whm/cpanel installation on your server, that can best be done by following these instructions.
This setup is also really not pertinent if you are only going to be hosting your single site, it will work but its overkill for it.
This is also assuming you have already got some dedicated IP;s, to do nameservers and run sites you really should have 3.
The first thing you need to do is spend some money. Yup, I am telling you right out to avoid all sorts of CRAP and register a domain SPECIFICALLY for the servers you will be hosting from. Even better is to register through a service like DynDns that gives you EXTENSIVE dns control over all domain settings. The benefits will be obvious when adding or removing servers.This is what I have done for macleodservers.com which, right now, is only one VPS but will be including some dedicated servers soon.
The following info will be based off that setup but I imagine other services/setups would be similar.

The first thing you need to do after registering your domain is just wait. let it sit awhile so dns propagates, better to wait now instead of finding stuff isn't working due to dns propagation.
give it a bit, there are a plethora of tools to let you know when its done.
After you are sure the domain registration is all set then in your dns zone you want to create A records for the servers shared ip and its 2 nameserver ip's.
Then you wait a bit for those records to update, usually 2 hours is enough. You can verify by pinging the FQDN and seeing if IP you entered are returned.

After verifying that you setup your machine. IMO its easier to name the server during setup as a member of the domain, for example vps.yourdomain.com, and make sure its using the shared IP you have set.
After the server is installed you will install whm/cpanel (I am not sure but DirectAdmin may be similar) per the install instructions and during setup you you enter the 2 nameserver names and ip's you already created A records for. In WHM you will also need to create A records for these and the shared ip and add them to the zone.

Once that is done and whm/cpanel all installed and updated you should be ready to host any domain. You can then add a cpanel domain/account like normal, make sure that your nameservers are defaulted, and then domain owner just needs to point to your 2 nameservers from his/her registrars account/dns settings.

Now lets say you have a lot of sites hosted and need to add a server, well all you need to do is go to, in this scenario, dyndns zone settings and add the 3 (2 NS and 1 Shared) IP's for the new server. Within a short time these names/ip's will be able to be used.

I messed around all week installing whm multiple times trying to use the same domain name for the server as I was using for sites hosted on it. It can be made to work but is really a LOT more trouble then its worth.
 

Infopro

Well-Known Member
May 20, 2003
17,091
516
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
...I messed around all week installing whm multiple times trying to use the same domain name for the server as I was using for sites hosted on it. It can be made to work but is really a LOT more trouble then its worth.
The trick is to add that domain first. If you did not add it first, you can move things around in your httpd.conf and then distill.
 

dmacleo

Active Member
Jan 28, 2012
44
0
56
cPanel Access Level
Root Administrator
I had done it first and it did work, but in the end it wasn't as useful as how I ended up. while I won't be hosting a lot there will be some.