Forum Discussion

Adam_Dainger_13's avatar
Adam_Dainger_13
Icon for Nimbostratus rankNimbostratus
Nov 26, 2013

Can the GTM respond to MX requests?

I have two LTMs set up with the following VIPs: Site A - 1.1.1.1 tcp/25 Site B - 2.2.2.2 tcp/25

 

I've been unable to configure my GTMs to respond to DNS MX requests.

 

I'd like to build an iRule, but upon reading the comments on the following page tells me that an iRule is only going to trigger if someone performs an "A" DNS query type. - https://devcentral.f5.com/questions/dns_request

 

GTM version 11.2.0

 

1 Reply

  • Hi Adam, If you have the license for DNS iRules (with DNS Services or GTM for example) then you should use that kind of iRule, and it works (tested it in my lab in 11.4):

    when DNS_REQUEST {
          if { ([string tolower [DNS::question type]] eq "mx")  &&  ([string tolower [DNS::question name]] eq "test.intra")} {
          DNS::answer clear
          set new_rr_1 [DNS::rr "mx.test.intra 100 IN MX 100 mx1.test.intra"]
          set new_rr_2 [DNS::rr "mx.test.intra" MX IN 600 "150 10.1.1.1"]
          set new_rr_1a [DNS::rr "mx1.test.intra" A IN 300 "10.10.10.10"]
          set new_rr_2a [DNS::rr "mx2.test.intra" A IN 50 "10.10.10.11"]
          DNS::answer insert $new_rr_1
          DNS::additional insert $new_rr_1a
          DNS::answer insert $new_rr_2
          DNS::additional insert $new_rr_2a
          DNS::header aa 1    
          DNS::return
    }
    }