Hi Ahmed,
a DNS response to an MX query contain just a FQDN value, so you don't need to care about wide IPs.
Check the iRule sample below to get an overview how MX DNS responses can be crafted...
when DNS_REQUEST {
if { ( [string tolower [DNS::question type]] eq "mx")
and ( [string tolower [DNS::question name]] eq "domain.de" ) } then {
Defining DNS answers for the requested MX records (Question Name = Domain Name, ttl = 600, class = IN, type = MX, data = priority FQDN)
DNS::answer insert [DNS::rr "domain.de 600 IN MX 100 mx1.domain.de"]
DNS::answer insert [DNS::rr "domain.de 600 IN MX 50 mx2.domain.de"]
Changing "Authorative Answer" DNS header to true.
DNS::header aa 1
Sending the DNS response
DNS::return
}
}
Note: After the DNS response has been received by the MTA, it will perform an additional A and/or AAAA record lookups for the received FQDNs. This is where the wide IP comes into play...
Cheers, Kai