A records used with redirect rules

Hi all, I’m just getting started using redirect rules. I understand I need a proxied A record that matches whatever redirect rule I’m setting up. The advice I’ve seen is to point the A record at 8.8.8.8. Presumably because the actual IP doesn’t matter much.

This feels a little kludgy to me. What is the best practice on this?

To illustrate what I’m saying. I set up a domain for example called mydomain.com. I want a redirect rule to send all requests to www.mydomain.com to www.someotherdomain.com. And then I create a proxied A record pointing www.mydomain.com to 8.8.8.8.

Am I understanding all this correctly? If so, what IP should I really be using for that A record?

Cloudflare Recommends (FAQ · Cloudflare DNS docs) 100:: (IPv6 Discard) or 192.0.2.0 (Reserved Address). I prefer AAAA 100:: because it’s entire purpose is to be “discard”, throw away all traffic which gets sent to it (RFC 6666: A Discard Prefix for IPv6).

Other IPs may work (although they have blocklisted a few like 1.1.1.1) because if your redirect rule is set up correctly, it will respond without ever trying your origin. However, if your redirect rule is misconfigured or doesn’t match, or something goes wrong, it would still try to contact the non-existent origin, so the idea is to use something that wouldn’t ever go anywhere.

It doesn’t matter the type (A or AAAA) when it is proxied since Cloudflare will use its own Proxy IPs. AAAA 100:: would work for both IPv4 or IPv6 Visitors, which may be helpful to clarify

5 Likes

Thank you. That’s very helpful.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.