Use same domain for two different subdomains? - web

I have a website called example.com.
I want www.example.com to point to my blog (on WordPress), but I want app.example.com to point to my app (on Heroku).
I am registered with Godaddy (could be any service though).
Is it possible to have one domain go to two completely different places?

Yes that is, just create two dns records for example:
www.example.com CNAME hosting.example.com
app.example.com A 109.23.23.45
cheers

Related

How to allow CNAME pointed to my server / how to use subdomain for a different server?

We create custom web apps for businesses and for the first time a client of ours has asked that instead of using our subdomain and instead of using a custom domain for their web app they would like to use their own subdomain for a domain currently hosted on another server.
For instance our domain is webapp.com and their domain is business.com. They would like app.business.com to be point to our name servers so we can continue hosting the web app for them.
I know it's possible to do this because we currently have outgoing CNAMEs on our server for help desks, etc, that aren't hosted on our own server but are using subdomains of ours.
Could you help me with what our client has to do on their zone editing side and what we need to do on our WHM/cPanel side to allow this?
NOTE: We had the client create a CNAME for app.business.com. pointed to our nameserver ns1.webapp.com and then we created an add-on domain for business.com and subdomain for app.business.com but when you try to visit app.business.com it gets the "Sorry!" cPanel page.
Thank you!
Alright I figured out how to do it on my own after a lot of testing & thought I'd post here to help others out in case they run across this in the future.
For the server with the subdomain on it have them create an 'A' record for that subdomain pointing to your server's IP address like so:
subdomain.business.com. ((note the extra period at the end is required))
TTL: 14400
Record Type: A
Pointing To: Your server's IP address.
Now on your server's cPanel you will need to create an addon domain for THAT subdomain (ie subdomain.business.com) - not for the actual business.com domain but for the entire subdomain subdomain.business.com with the folder being the root folder wherever you would like it to show.
That worked for me!
The CNAME should not point to your nameserver but your subdomain f.e. client1.webapp.com.
An other solution could be to add the subdomain app.business.com to your server and the client add an A record for the subdomain to your ip.

Having problems creating MX records for subdomain on dreamhost.

I have a domain on dreamhost, say block.com. This domain points to an address outside of dreamhost (amazon AWS).
I also have a subdomain, us.block.com that is hosted on AWS. This subdomain is not registered on dreamhost (as dreamhost doesn't allow subdomains to be hosted outside of dreamhost). To point to this subdomain, I've added in a couple of custom A records to the DNS records on dreamhost.
Since the subdomain is not registered on dreamhost, it doesn't allow me to add custom MX records. Is there anyway to get around this? If there isn't, can I somehow point the mail server of us.block.com to that of block.com without using mx records?
You can do that with a little trick:
Domains > Manage Domains
Fully host your subdomain
Under "Web Hosting" find "Remove" and press it
Now you can edit custom MX fields for your subdomain
Tested solution from here

Cloudflare redirecting to from one domain to another?

Is it possible to redirect from domainA.com to domainB.com without domainA.com having any DNS records?
I have two domains that I need to direct to another domain- the two domains don't have any other function than to be redirected. On Cloudflare these domains do not have any DNS records. Can you do this without directing them to a server and do the operations via .htacces, but by simply configuring it on CF?
Thanks!
The domain needs to have DNS records running through our proxy for our PageRules to work.

Difference between CNAME and SUBDOMAIN

What is the difference between a CNAME and a Subdomain?
I understand that the a cname (the left side of a domain) can point to the domain, so you can two different urls point to the same address, ie.
ex1.mydomain.com - if setup as a CNAME can return the IP of mydomain.com
If ex1.mydomain.com is setup as a subdomain, does it have a different IP?
Another question is what should the ideal setup be in this situation:
I have IP1:80 for a web app
I have IP2:80 for another app
Can I point both of these IPs to the same A record, with perhaps a different cname or subdomain?
Thanks for any help?
CNAME is agnostic about name topology - it simply provides a way to alias a lookup for one name into a lookup for another name. So it may be in a subdomain context, or not.
Your second question doesn't make any sense to me. An A record maps from a domain name to (a single) IP address. So normally, in this situation, you'd have two domain names with an A record for each.

Two subdomains pointing to two different hosts?

For example, let's say I have domain.com. Can I configure http://subdomain1.domain.com to be hosted on http://www.squarespace.com and http://subdomain2.domain.com to be hosted on http://www.discountasp.net/?
Yes. Set the A record of subdomain1 to point to the IP of your site at squarespace.com and the A record for subdomain2 to point to the IP being hosted at discountasp.net.
Yes - either use a CNAME record and point it to each of those domains, or an A record for the full domain (subdomain1.domain.com) pointed at the IP address you need.

Resources