GTM return LDNS IP to client

Problem this snippet solves:

We do a lot of our load balancing based on topology rules, so it's often very useful to know where the DNS request is actually coming from rather than just the client's IP and the DNS servers they have configured. Especially if they're behind an ADSL router doing NAT or some other similar set up.

This rule simply returns the IP address of the LDNS that eventually made the query to the GTM device in the response to a lookup for the WideIP using the rule, as well as logging the response and perceived location.

Code :

rule "DNS_debug" partition "Common" {
   when DNS_REQUEST {
        host [IP::client_addr]
        log local0.err "Debug address : [IP::client_addr] [whereis [IP::client_addr]]"
  }
}
Published Mar 17, 2015
Version 1.0

Was this article helpful?

No CommentsBe the first to comment