Bareword dns domain makes facter return incorrect info

Bug #1028268 reported by Brad Marshall
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
facter (Ubuntu)
Fix Released
Medium
Unassigned
Precise
Won't Fix
Medium
Unassigned

Bug Description

If you are using a bare word dns domain (.test for example), facter fqdn returns the incorrect information. Since there's no . in the domain, the checks fall back to parsing /etc/resolv.conf, which may not be correct.

$ hostname
eagle
$ dnsdomainname
test
$ facter fqdn
eagle.example.com

$ cat /etc/resolv.conf
search example.com
nameserver 192.168.1.1

If I edit resolv.conf to include domain test or include it as the first entry in search, facter returns the right value:

$ cat /etc/resolv.conf
domain test
search example.com
nameserver 192.168.1.1

$ facter fqdn
eagle.test

$ cat /etc/resolv.conf
search test example.com
nameserver 192.168.1.1

$ facter fqdn
eagle.test

The version of facter I tested this on is:

$ dpkg-query -W facter
facter 1.6.5-1ubuntu1

And this is running on precise:

$ lsb_release -rd
Description: Ubuntu 12.04 LTS
Release: 12.04

Please let us know if you need any more information.

Tags: canonistack
Robie Basak (racb)
Changed in facter (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Haw Loeung (hloeung) wrote :

Looks like this is fixed in facter-1.7.0-1ubuntu1 (saucy):

| elsif domain = Facter::Util::Resolution.exec('dnsdomainname') \
| and domain =~ /.+/
|
| return_value = domain

In facter-1.6.5-1ubuntu1.2 (precise), it looks like this:

| elsif domain = Facter::Util::Resolution.exec('dnsdomainname') \
| and domain =~ /.+\..+/
|
| domain

Regards,

Haw

Paul Collins (pjdc)
Changed in facter (Ubuntu Precise):
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Robie Basak (racb) wrote :

This appears fixed now:

ubuntu@trusty:~$ hostname
trusty
ubuntu@trusty:~$ dnsdomainname
test
ubuntu@trusty:~$ facter fqdn
trusty.test
ubuntu@trusty:~$ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
search example.com
nameserver 10.0.3.1
ubuntu@trusty:~$ dpkg-query -W facter
facter 1.7.3-1ubuntu1

Changed in facter (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Steve Langasek (vorlon) wrote :

The Precise Pangolin has reached end of life, so this bug will not be fixed for that release

Changed in facter (Ubuntu Precise):
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.