I have the Amazon Load Balancer. I tried to make one of my subdomains redirect requests to the load balancer. Following this doc (point Amazon ELB (Elastic Load Balancing)) I've created a new CNAME record in my domain on Cloudflare:
I waited >24 hours and I still get nothing on api.mydomain.com. I checked 3 addresses and got:
Check the load balancer (OK):
$ nslookup xxx.us-east-2.elb.amazonaws.com
Server: 192.168.1.1
Address: 192.168.1.1#53
Non-authoritative answer:
Name: xxx.us-east-2.elb.amazonaws.com
Address: 3.xx.xx.255
Name: xxx.us-east-2.elb.amazonaws.com
Address: 3.xx.xx.165
Check the main domain (OK):
$ nslookup mydomain.com
Server: 192.168.1.1
Address: 192.168.1.1#53
Non-authoritative answer:
Name: mydomain.com
Address: 108.xx.xx.71
Check the new subdomain (NOTHING):
$ nslookup api.mydomain.com
Server: 192.168.1.1
Address: 192.168.1.1#53
** server can't find api.mydomain.com: NXDOMAIN
Questions:
nslookup api.mydomain.com
return nothing? Doesn't it look like the subdomain wasn't created, so the problem isn't the connection between the load balancer and Cloudflare, but that Cloudflare hasn't created the subdomain?The problem was in poorly performed migration from OVH to Cloudflare by a previous developer. I'm putting here the way that helped me to find the root of the cause in case if it will help someone else.
What I did:
api.mydomain.com
and saw the response Status: NXDOMAIN
. But if I have correctly set up the CNAME to the AWS ELB as grey-clouded (DNS-only), I should get amazon IPs back from the resolver. Checker: http://dig.ping.pe/api.mydomain.com:NS:1.1.1.1Answering my own questions:
Should I do an additional setup to make it work? Nope. Adding the CNAME record is enough.
Why does nslookup api.mydomain.com
return nothing?
Because the subdomain wasn't created.
Do I need to configure Route 53 to make the load balancer work with Cloudflare? No, you don't need it.
Can SSL/TLS affect the problem? No