ltm rule command NAME responseΒΆ

iRule(1)					  BIG-IP TMSH Manual					     iRule(1)

NAME::response
       Deprecated: Returns a list of records received in response to a DNS query.

SYNOPSIS
DESCRIPTION
       Returns a list of records received in response to a DNS query made with the NAME__lookup command. If no
       records are returned, returns null.

       NAME::response If resolution of a name was requested, returns a list of up to 16 records received in response
       to a lookup request.  If reverse resolution of an address was requested, returns the name received in
       response.

       NAME::response address [] Returns the address record at the indicated offset from the list of records
       received in response to a lookup request. (Valid index values are 0 through 15 inclusive. If index is not
       specified, returns a list of up to 16 address records.)

       NAME::response name Returns the hostname received in response to a lookup request.

RETURN VALUE
       Returns a list of records received in response to a DNS query

VALID DURING
       NAME_RESOLVED

EXAMPLES
	#Resolve a name to a list of addresses & use the first one
	when ... {
	    NAME::lookup $myHostname
	}
	when NAME_RESOLVED {
	    log local0. "NAME_RESOLVED: [NAME::response]"
	    set server_ip [NAME::response address 0]
	}

	#Resolve an address to a name & log it:
	when CLIENT_ACCEPTED {
	    NAME::lookup [IP::client_addr]
	}
	when NAME_RESOLVED {
	    log local0. "Client IP resolves to [NAME::response name]"
	}

HINTS
SEE ALSO
       Destination Snat Using DNS  This iRule selects a snatpool based
       on which virtual called the iRule. and will select the member servers to use based on DNS resolution.

CHANGE LOG
       @BIGIP-10.0.0 --First introduced the command.  @BIGIP-15.1.0 --Deprecated in favor of RESOLVER and DNSMSG
       namespaces

BIG-IP						      2020-06-23					     iRule(1)