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
- hoolio
Cirrostratus
I quickly tested this as well on 10.2.0HF1 and RESOLV::lookup didn't work with a VIP address. I'll see about opening a case on this as well. Evan, if you do too, could you reply here with the case number?
Thanks, Aaron - Colin_Walker_12Historic F5 Account
- spark_86682Historic F5 AccountFor the RESOLV::lookup command, if you want to target a VIP, you should do so by name, not by IP. Have you tried doing that? Is there some reason you have to specify the VIP by IP?
- hoolio
Cirrostratus
No particular reason--I assumed a virtual IP would be treated the same way as any other IP address for RESOLV::lookup.
Jeffrey just updated the wiki page to say 'virtual name' instead of the original 'virtual'. Thanks for pointing this out.
Aaron - hoolio
Cirrostratus
I updated the wiki page to make this a bit clearer. Thanks for letting us know about the correct format.
Aaron - Colin_Walker_12Historic F5 AccountThanks spark and Aaron, good to know.
Colin - Thomas_Schaefer
Nimbostratus
I had an interesting thing come up recently. A new host name was added as an alias record of another host. Now when we call the NAME::Lookup, nothing comes back. If I dig the name on the BigIP command line, it works just fine. Does anyone know if there are issues with DNS records that use A and CNAME records?
Thanks,
Tom Schaefer - hoolio
Cirrostratus
Hi Tom,
Can you post an anonymized sample of the relevant DNS record(s) you're seeing the issue with?
Aaron - Thomas_Schaefer
Nimbostratus
Aaron,
Here you go...
C:\>nslookup fmservices.ocfo.mycompany.com
Server: dnr-anycast.mycompany.com
Address: 117.142.8.122
Name: fmservices.gss.mycompany.com
Address: 117.142.8.140
Aliases: fmservices.ocfo.mycompany.com
If I run dig, I see the alias as a CNAME record. My understanding from the other team is this is done like this for their load balancer that offers up addresses (3DNS).
Prior to the CNAME record being added, NAME::lookup worked fine. Now I get nothing back in the address list.
Time to ask support?
Thanks,
Tom - hoolio
Cirrostratus
So you're calling NAME::lookup fmservices.gss.mycompany.com which has a CNAME of fmservices.ocfo.mycompany.com?
I don't think NAME::lookup (or RESOLV::lookup) supports cnames. So you'd need to query for fmservices.ocfo.mycompany.com to get the A record for that. I'm not sure why we can't query for CNAMEs. You might open a support case to ask this. If you do, could you post the answer you get?
Thanks, 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