I didn’t really know how to title the question because it’s really more than what I titled this post, but that’s what explanations are for I guess. Here’s what I would like to do.
Someone very adept as fiddling with DNS records would be ideal for answering this question.
Here’s my topology so-to-speak.
I have a domain that I would like to split across two hosts. Here’s SPECIFICALLY what I mean.
I want to host example.com at one host and sub.example.com at another (DigitalOcean).
Now, as I understand it (it’s been years since I have messed with DNS records), I could achieve this by doing the following …
Setup my registrar’s DNS records like so …
example.com => IP of host1 sub.example.com => IP of host2 (DigitalOcean droplet)
In order to pull this off, I would have to tell the registrar that I want to use their nameserver. That would be step one. Then, configure the DNS records as shown above.
I’m just really not sure how I would do this.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Click below to sign up and get $100 of credit to try our products over 60 days!
Yes, the Droplet’s name should be a FQDN, so the entire dev.example.com (just to enable the PRT record creation).
Have a nice day, Alfio.
Ok, so I have this working now. It’s working flawlessly as follows.
example.com => Host 1 dev.example.com => Host 2
Now the final question remains …
When I setup a droplet, should I set the hostname (first input box) to “dev” or “dev.example.com” (the fully qualified domain name)? My guess would be the entire domain name dev.example.com, but I am unsure.
When the user agent request reaches the digital ocean servers, it expects to see the tnire thing I believe. Am I correct?
I just want to be clear — when you create a droplet, the “hostname” is NOT a “nickname” or something, it’s actually the name used to configure the server - as in the hostname of the machine (if it were a bare metal box).
I think I have solvedExample link my issue. We shall see. Here’s my current DNS configuration. I am trying to keep the nameserver configuration as close to the registrar as possible. It would be a hassle if I closed my account here or somewhere else (another host) and had to change where my custom DNS settings were. So, my registrar now holds this configuration.
Host #1 = The host that will handle the pretty website and all that javascript / css / php we love to mess around with.
Host #2 = The serious business host (DigitalOcean) where I can create a development test server.
Thanks to this amazing tool, I have this working exactly correctly.
The @ entry says when the domain is matched exactly, go to host #1 and pull the resource (site). The * says, whenever someone types in any subdomain OTHER than the exception (dev), still go to the host #1 and pull that resource (whatever it may be). The “dev” bit says, when the input matches exactly dev.example.com, go to host #2 (DigitalOcean). Perfect!
Does anyone see anything wrong with this? Will this configuration cause any DNS issues?
I didn’t really understand your question, I think, but this should be how to set the DNS as you asked:
Which registrar did you use? I can help you with Namecheap to set custom nameservers.