DNS::rrname¶
Description¶
Returns the name requested by the client.
Note: This command functions only in the context of GTM/BIG-IP DNS
iRules and requires the DNS Profile, which is only enabled as part of
GTM/BIG-IP DNS or the DNS Services add-on.
Syntax¶
[DNS::rrname]
[DNS::rrname]¶
- Returns the resource record name requested by the client. (e.g. devcentral.f5.com, or www.f5.com)
Examples¶
Checks the source IP address of each new DNS request, and if
10.10.10.0, uses pool GTM_pool1. If not, the request is checked to
make sure the resource record type is A (address) and the name is
www.domain.com, and if so, cnames the request to
www.redirect.domain.com:
when DNS_REQUEST {
if { [IP::addr [IP::client_addr] equals 10.10.10.0/24] } {
use pool GTM_pool1
} elseif { ([DNS::rrtype] eq "A") and ([DNS::rrname] eq "www.domain.com") } {
cname www.redirect.domain.com
}
}