Bug #7484

facter fqdn is empty when domainnames aren't containing any dot (ie tld)

Added by Edouard Bourguignon about 1 year ago. Updated 8 days ago.

Status:Closed Start date:05/11/2011
Priority:Normal Due date:
Assignee:Hailee Kenney % Done:

0%

Category:library
Target version:2.0.0
Keywords:tld fqdn hostname dot intern Affected Facter version:
Branch:https://github.com/puppetlabs/facter/pull/199
Votes: 1

Description

As far as I understand the following regexp used in domain.rb to find out the domainname:

    domain = Facter::Util::Resolution.exec('dnsdomainname')
    next domain if domain =~ /.+\..+/

domainname must contain a dot, which is not completely compliant with RFCs[¹] and prevent using facter on tld servers.

How to reproduce: On a server with fqdn “ns01.tld”, this is the result of some commands:

  • hostname => ns01 (OK)
  • hostname -f => ns01.tld (OK)
  • facter hostname => ns01 (OK)
  • facter fqdn => (bad)
  • dnsdomainname => tld (OK) but dnsdomainname command had to be installed

facter fqdn should return ns01.tld and should be (very important) consistent with “hostname -f”.

     "old-simple-name.ARPA".  That is, the all the hosts are in a
     domain called "ARPA"

Related issues

related to Facter - Bug #3909: Strip trailing dots from domain fact Closed 05/28/2010
duplicated by Facter - Bug #11229: On a clean, minimal install of Debian 6, `facter domain` ... Duplicate 12/06/2011
duplicated by Facter - Bug #3356: fact domain empty if domainname doesn't contain a dot (.) Duplicate 03/09/2010

History

Updated by Daniel Pittman about 1 year ago

  • Status changed from Unreviewed to Accepted

Thanks for this report, and the detailed problem analysis.

facter fqdn should return ns01.tld and should be (very important) consistent with “hostname -f”.

Can you expand on why that, specifically, is so important? That way we can be sure we understand your use-case and reasoning.

Updated by Edouard Bourguignon about 1 year ago

It’s important because other unices or applications/daemons are already using the hostname command to determine the short and full hostname (fqdn). So if this values are not the same than the facter hostname/fqdn, it could be problematic. We don’t want to use any command from dns client like dnsdomainname or modifying /etc/resolv.conf (they are simply not available).

Updated by James Turnbull 9 months ago

  • Category set to library

Updated by Ken Barber 6 months ago

  • Target version set to 1.6.x

Updated by Jeff Weiss 20 days ago

  • Keywords changed from tld fqdn hostname dot to tld fqdn hostname dot intern

Updated by Jeff Weiss 16 days ago

  • Assignee set to Hailee Kenney

Updated by Jeff Weiss 16 days ago

it looks like this would pull the tld from an /etc/resolv.conf if the domain or search fields existed in it. Granted this is probably not the behaviour we want to encourage.

Updated by Jeff Weiss 16 days ago

It’s rumoured that on Solaris hostname -f will set the hostname to -f. Hailee and I will look into this because it could adversely affect making the domain fact always match hostname -f.

Updated by Jeff Weiss 15 days ago

The Solaris hostname man page indicates Solaris run with hostname -f will indeed alter the system’s hostname to -f.

Updated by Hailee Kenney 15 days ago

  • Status changed from Accepted to In Topic Branch Pending Review
  • Branch set to https://github.com/puppetlabs/facter/pull/198

Updated by Hailee Kenney 14 days ago

  • Status changed from In Topic Branch Pending Review to Code Insufficient
  • Target version changed from 1.6.x to 2.0.0
  • Branch deleted (https://github.com/puppetlabs/facter/pull/198)

Using hostname -f is a potentially breaking change, so it should be targeted at Facter 2.0 instead of 1.6.x.

Also, HP-UX doesn’t handle hostname -f, so changing it to opt-in instead of opt-out.

Updated by Hailee Kenney 14 days ago

  • Status changed from Code Insufficient to In Topic Branch Pending Review
  • Branch set to https://github.com/puppetlabs/facter/pull/199

Updated by Hailee Kenney 14 days ago

  • Status changed from In Topic Branch Pending Review to Merged - Pending Release

Documentation added to pre-docs.

Updated by Hailee Kenney 14 days ago

  • Status changed from Merged - Pending Release to Code Insufficient

Updated by Hailee Kenney 14 days ago

  • Status changed from Code Insufficient to In Topic Branch Pending Review

Updated by Daniel Pittman 11 days ago

  • Status changed from In Topic Branch Pending Review to Merged - Pending Release

We believe that this has been fixed, and should be resolved in the release of Facter 2.0.0

Updated by Matthaus Litteken 8 days ago

  • Status changed from Merged - Pending Release to Closed

released in Facter 2.0.0rc1

Also available in: Atom PDF