Subdomain responding with a 404

I own bradgarropy.com and I’m using the Netlify DNS servers to link that domain to a Netlify site of the same name.

My goal is to create a subdomain for side projects. For example, murphy.bradgarropy.com should pass through to another Netlify site I own, https://murphee.netlify.app.

I created a CNAME entry in my DNS panel, but even after waiting for 24 hours I still get a 404 Not found response when I try to access murphy.bradgarropy.com.

Any help would be appreciated!

do you have a deploy to that subdomain, @bradgarropy?

@perry,
If you mean do I have a deploy to https://murphee.netlify.app, then yes! I’ve got a whole site running there.

If you mean do I have deploy to murphy.bradgarropy.com, then I may not understand how subdomains work… :sweat_smile:

I thought that by creating a CNAME entry, murphy.bradgarropy.com would serve up https://murphee.netlify.app. Is that correct?

Hi, @bradgarropy. That is one requirement and that has been done correctly.

There is one more step.

The DNS record does point to Netlify:

$ dig murphy.bradgarropy.com   +noall +answer

; <<>> DiG 9.10.6 <<>> murphy.bradgarropy.com +noall +answer
;; global options: +cmd
murphy.bradgarropy.com.	3599	IN	CNAME	murphee.netlify.app.
murphee.netlify.app.	19	IN	A	104.248.78.24
murphee.netlify.app.	19	IN	A	167.172.221.254

It is a CNAME record and points to the site subdomain under netlify.app. This is perfect.

However, once the web request gets to Netlify, how do we know what site to show? We host millions of websites. Which one do we display for this custom domain?

Answer: You add the custom domain under Site Name > Settings > Domain management > Custom domains. For this site, that setting is found here:

https://app.netlify.com/sites/murphee/settings/domain

Just click on that link (while logged in under your account) and you will be able to add the custom domain to the site and it should work.

If not or if there are any questions, please let us know.

Hi @luke,
So are you saying that I will need to purchase two domains? One for bradgarropy.com, and another for let’s say murphy.com?

Or are you saying that I need to add the bradgarropy.com subdomain to the murphee domain configuration?

I figured it out! Here’s what I had to do.

  1. Go to the murphee Netlify site and add a Custom domain of murphy.bradgarropy.com

That’s it! Netlify automatically created the CNAME mapping for me.

1 Like