cancel
Showing results for 
Search instead for 
Did you mean: 
Login & Join the DevCentral Connects Group to watch the Recorded LiveStream (May 12) on Basic iControl Security - show notes included.
SanjayP
MVP
MVP

Problem this snippet solves:

Currently there is no support for FQDN nodes in non-default route domains as per Article. With recent increase in cloud deployment, most of the time there is a requirement from F5 to load balance to servers or ELB in the cloud which has FQDN names as those are having dyanamic IP addresses. If you are using route domains in your BIGIP environment then this becomes a challenge.


Below iRule script can be used in those scenerios to use F5 to send traffic to FQDN nodes in non-default route domains.

How to use this snippet:

  • If FQDN needs to be resolved by your internal DNS, create performance layer 4 VIP (dns_53) load balancing your DNS servers.
  • DNS server can be used directly in the iRule itself, but it would be better to use a VIP to have redundancy.
  • Create iRule and apply to the VIP

Code :

when CLIENT_ACCEPTED { 
set host [RESOLV::lookup @dns_53 "server.example.com"]
set ip [getfield $host " " 1]
node [lindex $ip 0]% 
}

Tested this on version:

14.1
Comments
Manu_Nair
Cirrus
Cirrus

Thanks for this. i am not an irule expert, but i am trying to understand the code. 

set host [RESOLV::lookup @dns_53 "server.example.com"] -> So you are resolving the FQDN
set ip [getfield $host " " 1] -> Extracting the hostname
node [lindex $ip 0]%  -> I couldn get this one though!!, what it does. 

 

Version history
Last update:
‎16-Apr-2021 01:03
Updated by:
Contributors