Bug #2085

facter determins fqdn in strange and suboptimal ways

Added by Chris MacLeod almost 3 years ago. Updated over 1 year ago.

Status:Closed Start date:03/16/2009
Priority:High Due date:
Assignee:Luke Kanies % Done:

0%

Category:library
Target version:1.5.8
Keywords: Affected Facter version:
Branch:
Votes: 0

Description

In certain scenarios facter will make strange decisions in determining the value for the fqdn (and domain) fact. This can lead to misleading results.

In a NIS environment when a host is under a subdomin facter will use ‘domainname’ to determine the domain fact and then use that to set the fqdn fact. domainname (the command) will return the configured nis domain or “(none)” if no nis domain is configured.

— Example 1 — host in nis environment with subdomain

hostname

foo.bar.example.com

domainname

example.com

facter domain

example.com

facter fqdn

foo.example.com

— Example 2 — non-nis environment

hostname

foo.bar.example.com

domainname

(none)

facter domain

bar.example.com

facter fqdn

foo.bar.example.com

It seems that facter should use hostname if it’s set (and fully qualified) to determine the fqdn rather then try to build it from pieces. Assuming hostname is only reporting short hostname then building it from domainname is in consistent.

facter version: facter-1.5.2-1.el5 host os: rhel5


Related issues

related to Facter - Bug #3898: fqdn fact requires reverse PTR matches the forward Duplicate 05/27/2010

History

Updated by Luke Kanies almost 3 years ago

  • Category set to library
  • Status changed from Unreviewed to Accepted
  • Assignee set to Luke Kanies
  • Target version set to 1.6.0

Updated by Benedikt Böhm over 2 years ago

NIS should be a seperate fact. the following patch gets rid of NIS resolution in fqdn: http://github.com/hollow/facter/commit/92f6b049724a620f3833dde10b8126a70ce52a08

Updated by James Turnbull over 2 years ago

  • Priority changed from Normal to High

Updated by Paul Nasrat almost 2 years ago

  • Status changed from Accepted to Closed

Commited Ohad’s patch for this may revisit how all this works later though

Updated by James Turnbull over 1 year ago

  • Target version changed from 1.6.0 to 1.5.8

Also available in: Atom PDF