Sunday, October 1, 2017

DNS setup for a domain and its subdomain to point to different hosts



So here's what I have configured - I have a shared hosting account at dreamhost, and I've also just set up a VPS at intoVPS. The shared account is intended for mostly static sites and I'll be using the VPS to deploy rails apps.



Now although the VPS is (I think) set up well enough for now, I'm a bit confused about how to manage the DNS bits. Specifically here, I have a domain registered at another site, nettigrity. I'd like the top level domain to point to a static site on dreamhost, so till now its nameservers were set to the dreamhost nameservers. Now I want to put up some rails apps as subdomains. To manage DNS settings on nettigrity, I have to set the nameservers of the domain to interactivedns.com nameservers.



Once I do that, I can add A records, AAAA records, CNAME records, etc. I gather from what I've looked up about this topic that I have to create an A record to point to my VPS's static IP. I have no idea how to get the top level domain to point to dreamhost now though. Can someone explain what I should do? A primer on these record types or a link to one would be great..



IntoVPS, where my VPS is set up is, uses 'Hypanel' which has a 'My DNS Zones' section, where they provide their own nameservers. Could I use this instead of the registrars domain management service? Could one be better than the other for any reason?


Answer




I'm not directly familiar with any of the specific hosting services you mentioned, but I'll try to provide some useful tips:



I believe Hypanel's "My DNS Zones" section is only where you configure the DNS records that will be served by your domain names by IntoVPS. However, this, by itself, doesn't tell the rest of the world that lookups for your base domain name should query against IntoVPS's DNS service (that IntoVPS should be acting as your domain's nameserver). To do this, you need to tell your domain registrar to use IntoVPS's DNS servers as the DNS servers for your domain. (Your DNS registrar may also offer their own DNS nameserver hosting, in addition to just configuring the nameserver IPs to use for your domain, so don't get confused if you see both options.)



A list of DNS record types is available at http://en.wikipedia.org/wiki/List_of_DNS_record_types . Most of the time, you will be most concerned with A records, which associate a hostname to an IP address. AAAA records are the same thing, but for IPv6. CNAME records provide aliases. A common use of this would be to have one A record to store a common IP address, and then multiple CNAME records to that A record. You will also want to investigate the SOA (start of authority) and the NS (nameserver) records to properly configure your DNS.


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...