87. Hostname

Hostname manipulation routines

87.1. Authors

  • Michal Svec <msvec@suse.cz>

87.2. 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

87.3. Global Functions

87.3.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

See also:

  • rfc1123, rfc2396 and obsoleted rfc1034

87.3.2. CheckDomain

Check syntax of domain entry

Function parameters

  • string domain

Return value

  • boolean - true if correct

87.3.3. CheckFQ

Check syntax of fully qualified hostname

Function parameters

  • string host

Return value

  • boolean - true if correct

87.3.4. CurrentDomain

Retrieve currently set domain name

Return value

  • string - domain

87.3.5. CurrentFQ

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

Return value

  • string - FQ hostname

87.3.6. CurrentHostname

Retrieve currently set (short) hostname

Return value

  • string - hostname

87.3.7. MergeFQ

Merge short hostname and domain to full-qualified host name

Function parameters

  • string hostname

  • string domain

Return value

  • string - FQ hostname

87.3.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"]


87.3.9. ValidDomain

describe a valid domain name

Return value

  • string - description

87.3.10. ValidFQ

describe a valid FQ host name

Return value

  • string - describe a valid FQ host name

87.3.11. ValidHost

describe a valid host name

Return value

  • string - description

87.4. Global Variables

87.4.1. ValidChars

i18n characters in domain names are still not allowed

87.5. Module Requirements

87.5.1. Module Imports

  • IP
  • String

87.5.2. Module Includes