Forum Discussion
Kai_Wilke
Jan 19, 2016MVP
Hi Aref,
you may try the syntax below to intercept and respond to a specific SRV DNS query. It will also set authority information and additional records for the resolved SRV records to speed up DNS resolution (if supported by the DNS client).
when DNS_REQUEST {
log local0. "\[DNS::question name\]: [DNS::question name], \[DNS::question class\]: [DNS::question class], \[DNS::question type\]: [DNS::question type]"
set ttl 300
if { [string tolower [DNS::question name]] starts_with "_ldap._tcp.dc._msdcs.domain.de" } then {
if { [DNS::question type] equals "SRV" } then {
SOA information
DNS::authority insert "domain.de. $ttl IN SOA server1.domain.de hostmaster.domain.de 1337 900 600 86400 3600"
SRV response
DNS::answer insert "[DNS::question name]. $ttl IN [DNS::question type] 1 0 389 server1.domain.de"
DNS::answer insert "[DNS::question name]. $ttl IN [DNS::question type] 1 0 389 server2.domain.de"
Additional records
DNS::additional insert "server1.domain.de. $ttl IN A 192.168.1.1"
DNS::additional insert "server2.domain.de. $ttl IN A 192.168.1.2"
DNS::return
}
}
}
Note: The syntax can be used for v11.1+ LTM deployments.
Cheers, Kai