Load Balancer - how to handle www and non-www without IP disclosure

We’ve got a Load Balancer set to www.domain.com. What is the correct DNS setting to allow non-WWW to point to the same LB?

The receiving servers handle both traffic (and do perm. redirects to www. host) - I have used a CNAME (non-www to www) with an A record on the www, pointing to a single IP, which works but exposes the IP address. If I remove the A record, will it correctly points to the LB, or will the LB ignore traffic to non-WWW because it is not configured to route that traffic?

Thanks for any help on this.

It seems that, by using the CNAME pointing to www. (which is the LB address) it actually resolves to an IP address behind the LB, even though there are NO records (in the DNS settings) that point to that IP. So, we’re actually exposing an IP from behind the LB.

Any thoughts?

From Cloudflare support, using the non-www on “Proxy” mode will allow it to find the Load Balancer (even though it is only a CNAME and not an A/AAA record). This seems to have solved the issue. Thanks, Cloudflare

This topic was automatically closed after 30 days. New replies are no longer allowed.