Sawyer
Sawyer

Reputation: 241

CNAME rule to redirect subdomain to external site not working

I self-host my personal website on myDomain.com, which is a flask app served with apache. I am starting a personal blog, using a static site generator and netlify, which I would like to have hosted at blog.myDomain.com

I have set a CNAME rule for blog on the DNS provider for myDomain, which points to the netlify url customNetlifyDomain.netlify.com but this does not appear to be working. curl -v blog.myDomain.com returns

* Connected to blog.myDomain.com (ipv6.addr) port 80 (#0)
> GET / HTTP/1.1
> Host: blog.myDomain.com
> User-Agent: curl/7.47.0
> Accept: */*
> 
< HTTP/1.1 404 Not Found
< Cache-Control: max-age=30, public
< Content-Length: 9
< Content-Type: text/html; charset=utf-8
< Date: Sat, 16 Mar 2019 19:03:28 GMT
< X-Content-Type-Options: nosniff
< X-Frame-Options: ALLOWALL
< X-Request-Id: xxx
< X-Runtime: 0.007337
< Age: 0
< Connection: keep-alive
< Server: Netlify
< X-NF-Request-ID: xxx
< 
* Connection #0 to host blog.myDomain.com left intact
Not Found

I am able to ping blog.myDomain.com and get

 ping blog.myDomain.com
PING customNetlifyDomain.netlify.com (ip.addr) 56(84) bytes of data.
64 bytes from 142.93.108.123: icmp_seq=1 ttl=57 time=25.2 ms
64 bytes from 142.93.108.123: icmp_seq=2 ttl=57 time=34.7 ms
2 packets transmitted, 2 received, 0% packet loss, time 1001ms

And nslookup blog.myDomain.com:

Server:     127.0.1.1
Address:    127.0.1.1#53

Non-authoritative answer:
blog.myDomain.com   canonical name = customNetlifyDomain.netlify.com.
Name:   customNetlifyDomain.netlify.com
Address: ip.addr

Any suggestions appreciated!

Upvotes: 3

Views: 585

Answers (1)

talves
talves

Reputation: 14353

Make sure the subdomain alias is added to the domain management on your Netlify site.

enter image description here

Upvotes: 1

Related Questions