{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":1046,"path":"api-reference/server-api-reference/c_HostnameJSAPI.md","title":"HostnameJS - Global","bundle":null,"doc_type":null,"release":"australia","body":"\n# HostnameJS- Global\n\nThe HostnameJS script include provides methods to format host names according to property settings.\n\nUse with any server-side script when you need to format host names.\n\n**Parent Topic:**[Server API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/api-server.md)\n\n## HostnameJS - format\\(String hostname, String source\\)\n\nFormats the specified host name according to the property settings.\n\n|Name|Type|Description|\n|----|----|-----------|\n|hostname|String|The host name to format|\n|source|String|The property settings source|\n\n|Type|Description|\n|----|-----------|\n|String|The system name|\n\n## HostnameJS - getDomainName\\(\\)\n\nReturns the DNS domain name.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|String|The domain name|\n\n```\nvar hjs = new HostnameJS();\nhjs.getDomainName();\n```\n\n## HostnameJS - getSysName\\(\\)\n\nReturns the current system name.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|String|The system name|\n\n```\nvar hjs = new HostnameJS();\nhjs.getSysName();\n```\n\n"}}