Simple Sideband - iRule sideband the easy way
Code is community submitted, community supported, and recognized as ‘Use At Your Own Risk’.
Short Description
Simple Sideband is a helper iRule which makes getting started with doing iRule based ...
Published Jul 18, 2023
Version 1.0PeteWhite
Employee
Joined May 16, 2019
PeteWhite
Jul 19, 2023Employee
xuwen I have now added the ability to set the query type in the dns_query function.
when HTTP_REQUEST {
# Create DNS request
set q [call /Common/simple_sideband::dns_query "www.example.com" 28 ] <-- set qtype to be 28 ie AAAA
binary scan $q H* qhex
log local0.debug "query:$qhex"
# Send request to DNS server
set response [call /Common/simple_sideband::udp_req 10.67.182.10:53 $q {recv_bytes 1} ]
if { [lindex $response 0] == 0 } {
# Successful response - decode the DNS esponse
set data [lindex $response 1]
binary scan $data H* data_hex
log local0.debug "Success!: $data_hex"
set r [call /Common/simple_sideband::dns_response $data ]
HTTP::respond 200 content $r
} else {
HTTP::respond 500 content {failure}
}
}