Forum Discussion
Deepti_Nayak_26
Nimbostratus
Jun 06, 2017Irule for reverse DNS lookup
Hello ,
Currently we have applied Irule for DNS lookup & allowing DNS entries that only ends with a a particular fqdn
for e.g
when DNS_REQUEST {
set fqdn [DNS::question name]
...
dragonflymr
Cirrostratus
Jun 06, 2017Hi,
Not sure if I understand correctly - do you need to resolve IP to FQDN instead of FQDN to IP?
If so you need to check DNS query type like [DNS::question type] equals "PTR" and then execute necessary code - I guess you will need check then DNS_RESPONSE event to check if response from DNS server contains domain ending with given domain.
Something like that:
when DNS_RESPONSE {
if { [DNS::question type] eq "PTR" } {
set rrs [DNS::answer]
foreach rr $rrs {
if { [DNS::rdata $rr] ends_with "your.domain" } {
log local0. "----[DNS::rdata $rr] Dropped-----"
drop seems not be working for response
drop
DNS::answer clear
DNS::answer insert "@ 5 [DNS::question class] TXT Blocked"
return
}
}
}
}Piotr
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
