For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

Richard__Harlan's avatar
Richard__Harlan
Historic F5 Account
Jun 15, 2006

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's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus
    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
  • spark_86682's avatar
    spark_86682
    Historic F5 Account
    For 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's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus
    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's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus
    I updated the wiki page to make this a bit clearer. Thanks for letting us know about the correct format.

     

     

    Aaron
  • 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's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus
    Hi Tom,

     

     

    Can you post an anonymized sample of the relevant DNS record(s) you're seeing the issue with?

     

     

    Aaron
  • 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's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus
    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