Forum Discussion
Richard__Harlan
Jun 15, 2006Historic F5 Account
DNS Lookup
Playing with the following rule trying to get DNS lookups working. Every time I hit the rule the name::response allways comes back empty. Any ideas what I am doing wrong. Thanks
when HTTP_REQUEST {
set host [HTTP::host]
NAME::lookup $host
HTTP::collect
log "$host"
}
when NAME_RESOLVED {
set address [NAME::response address 0]
use node $address 80
log "$address"
HTTP::release
}
30 Replies
- Deb_Allen_18Historic F5 AccountI have not yet used the NAME:: commands, but I did find this code: (Click here which seems to use slightly different syntax for the NAME::response command.
HTH
/deb - Colin_Walker_12Historic F5 AccountYou also need to be sure that you've tweaked your configs appropriately, as is noted in the CodeShare page deb linked to in the above post. Use the syntax listed there along with the conf changes need, and you should be all set.
Colin - Thomas_Schaefer
Nimbostratus
Is this configuration still required on v9.4? I tried this and am get a blank response as well.
I'm just doing a brute force test to see if resolution is working. I assume this can be host to IP.when HTTP_REQUEST priority 5 { Hold HTTP data until hostname is resolved HTTP::collect Start a name resolution on the hostname NAME::lookup "www.xmission.com" } when NAME_RESOLVED { log local0. "client name = >[NAME::response]<" Release HTTP data once hostname is resolved HTTP::release }
Thanks,
Tom Schaefer - Adrian_1807
Nimbostratus
Hi,
One question. When doing the NAME::lookup, i understand it will send a name resolution petition to a DNS. My question is where to configure the DNS where the petitions will be sent. Can it be specified in the command, or it must be done in other configuration??
Thank you very much.
BR - hoolio
Cirrostratus
hi Adrian,
For 9.4.2+ you can use the steps in SOL8437:
SOL8437: Configuring BIG-IP to resolve DNS hostnames
https://support.f5.com/kb/en-us/solutions/public/8000/400/sol8437.html
For older versions, you can check SOL3624:
SOL3624: Configuring DNS name resolution
https://support.f5.com/kb/en-us/solutions/public/3000/600/sol3624.html
And here are a few examples of using NAME::lookup and validating the response:
http://devcentral.f5.com/wiki/default.aspx/iRules/DestinationSnatUsingDNS.html
http://devcentral.f5.com/Default.aspx?tabid=53&forumid=31&tpage=1&view=topic&postid=8551885545
SOL5299: The BIG-IP system does not forward DNS requests after configuring the BIND Forwarder Server List
https://support.f5.com/kb/en-us/solutions/public/5000/200/sol5299.html
Aaron - JRahm
Admin
With NAME::lookup, the event NAME_RESOLVED fires when the resolution occurs and you use NAME::response to retrieve it. New in 10.1 is the RESOLV::lookup command, which suspends and returns the results inline. - JRahm
Admin
ha! Yeah, I do need to get that documentation cranked out. I've also wondered as commands are added...why? That would be a good feature to add in the wiki entries. I'll dig and see what I can come up with. - JRahm
Admin
There are several more commands I need to "voluntarily" get out there as well. - JRahm
Admin
Posted By hoolio on 01/19/2010 7:26 AM
Out of curiosity, why was this change done? Is the idea that you don't use the NAME_RESOLVED event in v10.1, but just call NAME::lookup (or RESOLV(E?)::lookup to resolve the name and get the return in the original event?
Thanks,
Aaron
We now have the capability to suspend execution until we get an asynchronous response, so we are moving commands in that direction. Any new commands that have an asynchronous response will now always be inline. - hoolio
Cirrostratus
Thanks for the info. Currently with NAME::lookup does all TMM processing wait until NAME_RESOLVED is triggered? With RESOLV::lookup, is that different?
Aaron
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
