Bareword dns domain makes facter return incorrect info
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.
Changed in facter (Ubuntu): | |
status: | New → Triaged |
importance: | Undecided → Medium |
Changed in facter (Ubuntu Precise): | |
status: | New → Confirmed |
importance: | Undecided → Medium |
Looks like this is fixed in facter- 1.7.0-1ubuntu1 (saucy):
| elsif domain = Facter: :Util:: Resolution. exec('dnsdomain name') \
| and domain =~ /.+/
|
| return_value = domain
In facter- 1.6.5-1ubuntu1. 2 (precise), it looks like this:
| elsif domain = Facter: :Util:: Resolution. exec('dnsdomain name') \
| and domain =~ /.+\..+/
|
| domain
Regards,
Haw