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

Azzeddine_S's avatar
Mar 23, 2017

Trim function with DNS records

hi all

i am writing an irule to manipulate the DNS record as it passes through a DNS virtual server by adding a string at the begining of the request name but i cannot remove a white space forme the DNS::question name variable even with trim function the iRule is as follow

when DNS_REQUEST {

set myname [concat "dc1."[string trimleft [DNS::question name " "]]]

log local0. "FQDN is $myname"

}

the output is :

Mar 23 10:46:38 BigIP1 info tmm[11026]: Rule /Common/DNS_String : FQDN is dc1.

Mar 23 10:46:38 BigIP1 info tmm[11026]: Rule /Common/DNS_String : FQDN is dc1.

Mar 23 10:46:38 BigIP1 info tmm[11026]: Rule /Common/DNS_String : FQDN is dc1.

Mar 23 10:46:38 BigIP1 info tmm[11026]: Rule /Common/DNS_String : FQDN is dc1.

there is a space between the string "dc1." and ";

thanks a lot for the help

2 Replies

  • try this code

     

    when DNS_REQUEST {
        set dnsdomain [string trimleft [DNS::question name " "]]
        set myname "dc1.$dnsdomain"
        log local0. "FQDN is $myname"
    }