0

Complete server noob trying to setup a new cloud server account here. I've only dealt with shared-hosting accounts in the past, so I don't have much experience as a network admin setting up servers.

What I want to achieve:

I have 2 domain names: primarydom.com and otherdom.com. Primarydom.com is my primary domain name of course. I want both of these to point to the same server, serving 2 different Django websites.

Questions:

  1. My host told me that I should setup my own nameserver if I want to serve different domain names. Is that the best way to go about it? If not, then how?

  2. I was given 2 IP addresses by my host, 1 public and 1 private. If I want to setup my own nameservers, do I use the public and private addresses as NS1 and NS2? Or do I just use the public one, in which case NS1 and NS2 would have the same IP address?

  3. If I have ns1.primarydom.com and ns2.primarydom.com nameservers, do I then create an NS record pointing to said nameservers for www.primarydom.com to serve a website?

I was given a CentOS server with Interworx control panel, if that helps.

Thanks a lot guys!

2 Answers 2

1

As a relative newcomer to server administration, I would strongly suggest you find someone to handle your DNS requirements for you. I'm pretty sure you're going to have you hands full getting your box up without adding the complication of correctly setting up and managing a DNS server. there are a bunch of DNS providers in this thread.

If the cloud server you are talking about is a virtual server/VPS of some sort (which is what it sounds like) then the public IP is for internet use (i.e. both of your domains will point to that IP, and your webserver will use virtual hosts/host headers to determine which site to send the traffic to) - I'm not sure why your host has indicated you need to run your own DNS server to achieve this. I guess it depends on how you phrased the question :)

So, you would setup the A records for both domains to point to the same IP (using either your providers DNS control panel or your DNS provider of choice), and then your webserver (assuming apache) would have a virtual hosts section for each site (generally defined with the ServerName directive). If you are using a control panel, I would guess this is available within the web server configuration somewhere.

The private IP would (generally) be to communicate with other virtual servers at the same provider, should you have them - e.g. where you have a web server and separate database server, or standby/backup servers that would communicate internally.

5
  • Thanks for your answer! I imagined the way all this works just as you described it, especially the Apache part. Glad I wasn't completely blind as I had thought. I miraculously set things up correctly, fortunately! I registered my nameservers ns1.primarydom.com and ns2.primarydom.com to the same Public IP address, and I set www.primarydom.com's DNS to said Nameservers. At least that much is good; I can now SSH to [email protected] instead of [email protected]. 1 question though; both my ns1 and ns2 are using the same IP address. Is this ok? Because usually they have different IPs.
    – rabbid
    Apr 27, 2011 at 9:39
  • you can, but it's not recommended. Generally you have a primary and secondary nameserver (NS) for redundancy, so having them on the same IP wouldn't achieve much. usually when you have in-zone NS records (i.e. the authoritive name server(s) for a given zone are in the same zone, like ns1.bob.com being authoritive for bob.com) you require a glue record at the registrar as well. I would strongly suggest contacting you provider to figure out if they can manage the DNS for you, or give you an idea of what best practice with their control pannel/system is. Apr 27, 2011 at 9:45
  • Should I just keep using Namecheap's DNS servers then? I can just create A records pointing to my public IP address for both of my domain names, and setup the correct VirtualHosts for them right?
    – rabbid
    Apr 27, 2011 at 9:53
  • yes. when it doubt, simple & straightforward always wins :) Apr 27, 2011 at 9:57
  • Great! Glad I got that right. I understand this whole DNS stuff much better now. Thanks! :)
    – rabbid
    Apr 27, 2011 at 12:08
0
  1. No you don't need to. Actually, in order to serve your domain on your own nameservers, you should have at least 2 different servers, preferable on different network segments and geographical locations. In your case, it's much better to use 3-rd pary dns hosting. Domain Name registrat usually offers one, often for free. In another case, just use any provider you'd like (google for 'dns provider' or 'managed dns serice'), for example amazon's one.
  2. No, you can't set up private ip for ns server. You must have at least 2 different public ip addresses in order to serve 2 dns servers.
  3. No, once you'll have your domain hosted somewhere, you'll need to add A (A-type, not NS) records pointing to ip of your server. Examples of the record: primarydom.com. IN A 1.2.3.4 www.primarydom.com. IN A 1.2.3.4

Here is a quite good beginner article about DNS system: http://www.htmlgoodies.com/beyond/webmaster/article.php/3473261/An-Introduction-to-DNS.htm

2
  • Thanks for your answer! My nameservers are now working, and they point to the same IP address. Is this bad? Should I stick with namecheap's DNS server?
    – rabbid
    Apr 27, 2011 at 9:40
  • That's not good, I believe it's better to use namecheap's DNS server. Actually, I did't even thought it's possible to point both ns to same IP. Some zones (e.g. .ru) does not allow this.
    – rvs
    Apr 27, 2011 at 10:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .