Options

Finding hostname.tld in FQDN

mischamischa Member
Posted by mischa

This will find the hostname + tld from the FQDN.
Basically removing "www." from the average request.
www.a10networks.com becomes a10networks.com

Code:

set HOST [string tolower [HTTP::host]] set HOST_LIST [split $HOST "."] set HOST [lindex $HOST_LIST [expr [llength $HOST_LIST]-2]].[lindex $HOST_LIST [expr [llength $HOST_LIST]-1]]
Sign In or Register to comment.