Bug #2085

facter determins fqdn in strange and suboptimal ways

Added by Chris MacLeod over 1 year ago. Updated 3 months ago.

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

0%

Category:library
Target version:1.6.0
Keywords: 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

Associated revisions

Revision dca615c98b864d75e2ac5899d98d04a2bd979eba
Added by Ohad Levy 5 months ago

fixes #2573, #2085, #1291 – fixes domain and fqdn facts resolution

This patch removes the relationship between the domain fact and LDAP/NIS domains. domain fact relates to DNS domain – this will avoid the confusion caused by the LDAP/NIS domain (which might be different to the DNS domain name). Additionally, if hostname is already in long form, it won’t try to build the fqdn fact from hostname and domain.

History

Updated by Luke Kanies over 1 year ago

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

Updated by Benedikt Böhm 11 months 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 9 months ago

  • Priority changed from Normal to High

Updated by Paul Nasrat 5 months ago

  • Status changed from Accepted to Closed

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

Also available in: Atom PDF