HostnameJS - Global

concept brazil Updated Sep 10, 2026 1 min read c_HostnameJSAPI.md
Raw file servicenow.com

The HostnameJS script include provides methods to format host names according to property settings.

Use with any server-side script when you need to format host names.

Parent Topic:Server API reference

HostnameJS - format(String hostname, String source)

Formats the specified host name according to the property settings.

Name Type Description
hostname String The host name to format
source String The property settings source
Type Description
String The system name

HostnameJS - getDomainName()

Returns the DNS domain name.

Name Type Description
None
Type Description
String The domain name
JavaScript
var hjs = new HostnameJS();hjs.getDomainName();

HostnameJS - getSysName()

Returns the current system name.

Name Type Description
None
Type Description
String The system name
JavaScript
var hjs = new HostnameJS();hjs.getSysName();
Search documentation
Search document titles and file paths on the brazil branch