Forum Discussion

Tony_Li_89728's avatar
Tony_Li_89728
Historic F5 Account
Jan 18, 2006

DNS Response Rewrite

Can we modify the payload of dns response?

 

 

The customer would like to check the dns response,if there has the "DNS: Response Code: 3 (Name Error)" in the payload then bigip will modify the reply with a specific ip address to answer the dns query.

 

 

Rules gurus,do you have any idea for it?

 

 

 

  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    Well, you can certainly modify the response, as it's passing through the BIG-IP. As far as the DNS response status, there isn't currently an iRules variable in place for that information. This means you'll have to read through the information coming back from the DNS server and decipher the status yourself using a scan, string match, etc.

     

     

    Once you do this, you'll add some logic to alter the IP address if necessary.

     

     

    I'd start by taking a look at the UDP::payload, UDP::respond and "string match" commands. Note that the string matching commands in iRules are not F5 specific, they are standard TCL syntax. For a good tcl reference I recommend - Click here - http://tmml.sourceforge.net/doc/tcl/index.html

     

     

    HTH,

     

    -Colin