Forum Discussion

upatel209_95128's avatar
upatel209_95128
Icon for Nimbostratus rankNimbostratus
Apr 14, 2014

DNS caching

when RULE_INNIT {

 Hostname to resolve to IP - Production
set ::EBSProductionHost "EBS.Production.Nationalgrid.net"

 Time in ms after which to re-query DNS server 
set ::QueryTime 30000

table add -subtable "DNS" "Production" "[RESOLV::lookup @13.13.13.13 $::EBSProductionHost]" indef
    after $::QueryTime - periodic { table replace -subtable "DNS" "Production" "[RESOLV::lookup @13.13.13.13 $::EBSProductionHost]" indef }

}

when CLIENT_ACCEPTED {

 Retrieve VIP address from table and define variable
set ::VIP [table lookup -subtable "DNS" "Prodution"]

 Select the IP 
log local0. "IP resolved! - [lindex $::VIP 0]"
node [lindex ::VIP 0] 21

}

2 Replies

  • I am getting syntex error. I want to configure dns caching for 30min locally for a quick user response. Can someone advise where I am going wrong
  • Not sure if it's a typo when you pasted it in here, but it should be:

     

    when RULE_INIT, not RULE_INNIT