Download This Guide
Supported Platforms
Related Documentation
- ACX, EX, M, MX, PTX, SRX, T Series
- Summary of Extension Functions in the jcs and slax Namespaces
- dampen() Function (jcs and slax Namespaces)
- parse-ip() Function (jcs Namespace)
- sleep() Function (jcs and slax Namespaces)
- sysctl() Function (jcs and slax Namespaces)
- ACX, EX, M, MX, SRX, T Series
- Junos Script Automation: Understanding Extension Functions in the jcs and slax Namespaces
hostname() Function (jcs Namespace)
Namespaces
SLAX Syntax
XSLT Syntax
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
- ACX, EX, M, MX, PTX, SRX, T Series
- Summary of Extension Functions in the jcs and slax Namespaces
- dampen() Function (jcs and slax Namespaces)
- parse-ip() Function (jcs Namespace)
- sleep() Function (jcs and slax Namespaces)
- sysctl() Function (jcs and slax Namespaces)
- ACX, EX, M, MX, SRX, T Series
- Junos Script Automation: Understanding Extension Functions in the jcs and slax Namespaces
Published: 2013-03-05
Download This Guide
Supported Platforms
Related Documentation
- ACX, EX, M, MX, PTX, SRX, T Series
- Summary of Extension Functions in the jcs and slax Namespaces
- dampen() Function (jcs and slax Namespaces)
- parse-ip() Function (jcs Namespace)
- sleep() Function (jcs and slax Namespaces)
- sysctl() Function (jcs and slax Namespaces)
- ACX, EX, M, MX, SRX, T Series
- Junos Script Automation: Understanding Extension Functions in the jcs and slax Namespaces