Forum Discussion
How to block DNS request according to one special domain list ?
I am using LTM to LB cache DNS for one SP. By now , customer ask whether we can block the DNS request according to one special list? For example, they want to block :
block list {
*.youtube.com <----- one domain
www.a.com <--- one exactly hostname
*.tudou.com.cn
*.cn <---- one country
....
}
and , this type list may reach nearly 2000-3000 lines
so, I have two questions :
1> do we support dns request function in iRule on LTM now?
2> how to improve performance of the irule , if we need use matchclass to compare 2000 more lines ?
3> is there any good idea to compare this type mixed domain/hostname and even multi-level domain datagroup ?
Thanks.
Raymond
- hooleylistCirrostratusDo you want to block DNS queries from clients through an LTM virtual server? Or is this for HTTP or HTTPS? If HTTP or HTTPS, are you looking for LTM to act as an HTTP proxy?
- Nat_ThirasuttakornEmployee
Hi Raymond, if it is for DNS queries fro mclient through LTM, i think you have at least 2 more options 1) use DNS profile, I am not quite sure dns profile comes with what version of BIG-IP (and perhap with GTM license) anyway, I guess the iRule would be something like.... (I never test it this way so I dont know for sure) when DNS_REQUEST { switch -glob [DNS::rrname] { *.youtube.com - www.a.com - *.tudou.com.cn - *.cn { not sure if UDP::drop work in DNS_REQUEST though... UDP::drop } } }2) if DNS profile is not an option, try the following UDP iRule to make it fast, you may hardcoded dns domain name (as in the way it is encoded in DNS protocol - len followed by name, ...) you can also create script to convert between normal domain format to dns encoded (e.g. from www.a.com to \x03www\x01a\x03com) when CLIENT_DATA { binary scan [UDP::payload] * id dname question set dname [string tolower [getfield $dname \x00 1]] switch -glob $dname { *\x07youtube\x03com - \x03www\x01a\x03com - *\x05tudou\x03com\x02cn - *\x02cn { *.youtube.com www.a.com *.tudou.com.cn *.cn UDP::drop } default { log local0. "does not match, pass it through" } } }Nat
- hooleylistCirrostratusIn v11 at least, I think you can create an LTM virtual server with a DNS profile and then use DNS::rrname.
Recent Discussions
Related Content
* 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