83. Hostname

Hostname manipulation routines

83.1. Summary of Module Globals

List of Global Functions

  • Check - Check syntax of hostname entry (that is a domain name component, unqualified, without dots)

  • CheckDomain - Check syntax of domain entry

  • CheckFQ - Check syntax of fully qualified hostname

  • CurrentDomain - Retrieve currently set domain name

  • CurrentFQ - Retrieve currently set fully qualified hostname (uses hostname --fqdn)

  • CurrentHostname - Retrieve currently set (short) hostname

  • MergeFQ - Merge short hostname and domain to full-qualified host name

  • SplitFQ - Split FQ hostname to hostname and domain name

  • ValidDomain - describe a valid domain name

  • ValidFQ - describe a valid FQ host name

  • ValidHost - describe a valid host name

List of Global Variables

  • ValidChars - i18n characters in domain names are still not allowed

83.2. Global Functions

83.2.1. Check

Check syntax of hostname entry (that is a domain name component, unqualified, without dots)

Function parameters

  • string host

Return value

  • boolean - true if correct

83.2.2. CheckDomain

Check syntax of domain entry

Function parameters

  • string domain

Return value

  • boolean - true if correct

83.2.3. CheckFQ

Check syntax of fully qualified hostname

Function parameters

  • string host

Return value

  • boolean - true if correct

83.2.4. CurrentDomain

Retrieve currently set domain name

Return value

  • string - domain

83.2.5. CurrentFQ

Retrieve currently set fully qualified hostname (uses hostname --fqdn)

Return value

  • string - FQ hostname

83.2.6. CurrentHostname

Retrieve currently set (short) hostname

Return value

  • string - hostname

83.2.7. MergeFQ

Merge short hostname and domain to full-qualified host name

Function parameters

  • string hostname

  • string domain

Return value

  • string - FQ hostname

83.2.8. SplitFQ

Split FQ hostname to hostname and domain name

Function parameters

  • string fqhostname

Return value

  • list<string> - of hostname and domain name

Example 17. 

 Hostname::SplitFQ("ftp.suse.cz") -> ["ftp", "suse.cz"]
 Hostname::SplitFQ("ftp") -> ["ftp"]


83.2.9. ValidDomain

describe a valid domain name

Return value

  • string - description

83.2.10. ValidFQ

describe a valid FQ host name

Return value

  • string - describe a valid FQ host name

83.2.11. ValidHost

describe a valid host name

Return value

  • string - description

83.3. Global Variables

83.3.1. ValidChars

i18n characters in domain names are still not allowed

83.4. Module Requirements

83.4.1. Module Imports

  • IP
  • String

83.4.2. Module Includes