Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All
     

    Related Documentation

     

    hostname() Function (jcs Namespace)

    Namespaces

    http://xml.juniper.net/junos/commit-scripts/1.0

    SLAX Syntax

    var $name = jcs:hostname(expression);

    XSLT Syntax

    <xsl:variable name="name" select="jcs:hostname(expression)"/>

    Release Information

    Function introduced in Junos OS Release 9.3.

    Description

    Return the fully qualified domain name associated with a given IPv4 or IPv6 address. The DNS server must be configured on the device in order to resolve the domain name.

    Parameters

    expression
    —

    IPv4 or IPv6 address.

    Return Value

    name
    —

    Hostname associated with the IP address.

    Usage Examples

    The following example initializes the variable address with the IP address 10.10.10.1. The $address variable is passed as the argument to the jcs:hostname() function. If the DNS server is configured on the device, the function will resolve the IP address and return the fully qualified domain name, which is stored in the variable host.

    var $address = "10.10.10.1";
    var $host = jcs:hostname($address);
    

    In XSLT:

    <xsl:variable name="address" select="10.10.10.1">
    <xsl:variable name="host" select="jcs:hostname($address)"/>
    
     

    Related Documentation

     

    Published: 2013-03-05