Forum Discussion

VFB's avatar
VFB
Icon for Cirrus rankCirrus
Dec 18, 2019

GTM / BIG-IP DNS URL redirect

I'm trying to write an iRule for GTM/BIG-IP DNS to redirect a client based on the URL they queried. If they query www.test.com (WIP), it will redirect them to www.test2.com. Thanks.

2 Replies

  • This can straightforwardly be done using a DNS CNAME record ...whereby you would define www.test.com so that it resolves not to an IP address but rather to the hostname www.test2.com (that will then resolve to an IP address). Specifically, www.test.com would be an alias for the canonical name www.test2.com.

     

    Assuming that we are under IPv4 to keep things simple: At the level of the wide-IP (WIP), you can define www.test.com as an WIP with a record type of A ... with resolution to www.test2.com as a static CNAME that resolves to an IPv4 address (or as itself being a WIP with a record type of CNAME that resolves to a load balancing pool of virtual server IPv4 addresses).

     

    Additional Note #1: It would be good practice to additionally configure www.test.com as a WIP of type CNAME that resolves in the same way that the WIP of record type A does.

     

    Additional Note #2: See the excellent devcentral article that explains all of the above and a lot more:

     

    BIG-IP DNS Resource Record Types: Architecture, Design and Configuration

    https://devcentral.f5.com/s/articles/BIG-IP-DNS-Support-for-NAPTR-SRV-and-MX-Records