Forum Discussion

Ken_Wong_48678's avatar
Ken_Wong_48678
Historic F5 Account
Sep 19, 2008

NAME::response question

I test an irule using NAME::response but never to make it works. Is there any mistakes?

 

 

I can log the hostname but there is nothing for the response. I run a tcpdump in LTM and see it send out dns requests and get responses. TIA

 

 

Regards,

 

Ken

 

 

 

when HTTP_REQUEST {

 

set myHostname [HTTP::host]

 

NAME::lookup $myHostname

 

log local0. "NAME: $myHostname"

 

}

 

 

when NAME_RESOLVED {

 

log local0. "NAME_RESOLVED: [NAME::response]"

 

}

 

5 Replies

  • spark_86682's avatar
    spark_86682
    Historic F5 Account
    Has the HTTP connection already closed by the time the DNS response gets back to the LTM? That would certainly cause this problem. Try something like:

     
     when HTTP_REQUEST { 
       set myHostname [HTTP::host] 
       NAME::lookup $myHostname 
       log local0. "NAME: $myHostname" 
       HTTP::collect 
     } 
      
     when NAME_RESOLVED { 
       log local0. "NAME_RESOLVED: [NAME::response]" 
       HTTP::release 
     }  
     
  • Ken_Wong_48678's avatar
    Ken_Wong_48678
    Historic F5 Account
    Thanks spark, I tried but no luck....any other suggestions or does it look like a bug?

     

     

    Regards,

     

    Ken
  • Colin is right, when willing to use DNS resolution you need to do some configuration on the LTM to make it work,

     

     

    you should have a look at this sol, it will guide youClick here
  • I got stuck on this as well. I had to allow TMM to query named from its 127.1.1.2 address and enable recursion. As long as I was enabling recursion, I created a new view for just loopback address clients.

    For my later reference, to view more verbose named debug output you can stop named using 'bigstart stop named' and then run it from the command line using:

    /usr/sbin/named -g -t /var/named -u named -c /config/named.conf -d 2

    [bigip945:Active] cat /var/named/config/named.conf

     
     restrict rndc access to local machines 
     use the key in the default place: /config/rndc.key 
      
     controls { inet 127.0.0.1 port 953 allow { 127.0.0.1 ;}; }; 
      
     logging { 
         channel logfile { 
             syslog daemon; 
             severity error; 
             print-category yes; 
             print-severity yes; 
             print-time yes; 
         }; 
         category default { 
             logfile; 
         }; 
         category config { 
             logfile; 
         }; 
         category notify { 
             logfile; 
         }; 
     }; 
      
     options { 
             listen-on port 53 { 127.0.0.1; }; 
             listen-on-v6 port 53 { ::1; }; 
      set this to yes when you want to resolve off 
      box. setting it to yes when you dont actuallly 
      have a bind server configured will result in 
      bind timeouts for many commmands 
             recursion no; 
             directory "/config/namedb"; 
             allow-transfer { 
                     localhost; 
             }; 
         check-names master warn; 
      
      change to "no" if you want to be able to add 
       MX records that do not reference a record that has an A record 
         check-integrity yes; 
     }; 
      
     acl "zrd-acl-000-000" { 
         127.10.0.0; 
     }; 
     acl "local-loopback-clients" { 
         127.0.0.0/8; 
     }; 
     view "internal" { 
             match-clients { "local-loopback-clients"; }; 
             recursion yes; 
     }; 
     view "external" { 
             match-clients { "zrd-acl-000-000"; any; }; 
     }; 
     

    Aaron