domain.rb

Path: lib/facter/domain.rb
Last Update: Wed May 15 15:18:55 +0000 2013

Fact: domain

Purpose:

  Return the host's primary DNS domain name.

Resolution:

  On UNIX (excluding Darwin), first try and use the hostname fact,
  which uses the hostname system command, and then parse the output
  of that.
  Failing that it tries the dnsdomainname system command.
  Failing that it uses /etc/resolv.conf and takes the domain from that, or as
  a final resort, the search from that.
  Otherwise returns nil.

  On Windows uses the win32ole gem and winmgmts to get the DNSDomain value
  from the Win32 networking stack.

Caveats:

Required files

facter/util/registry   facter/util/wmi  

[Validate]