title: Puppet/Facter "Could not retrieve fact fqdn": How to fix or circumvent?
body: <p>I'm learning about puppet and trying to experiment with it on a VM at home. I'm not using a puppet server yet, just running things locally. It works okay, but every time I run <code>puppet apply ...</code>, I get a delay of several seconds, after which it displays the message</p>
  
  <pre><code>warning: Could not retrieve fact fqdn
  </code></pre>
  
  <p>I assume the message is linked to the delay, and I want to get rid of it (the delay--I can live with the message). Googling for a solution seems to indicate that it's somehow related to DNS lookups, but I can't really find anything else about it, which seems surprising. All I want is to be able to apply manifests in my vm quickly so I can experiment. How can I speed things up?</p>
  
  <p><strong>Update:</strong> I don't see any extra info in the debug output, but it looks like this:</p>
  
  <pre><code>$ puppet apply -dv puppet-1.pp 
  warning: Could not retrieve fact fqdn
  debug: Failed to load library 'rubygems' for feature 'rubygems'
  debug: Failed to load library 'selinux' for feature 'selinux'
  debug: Puppet::Type::File::ProviderMicrosoft_windows: feature microsoft_windows is missing
  ...
  </code></pre>
  
  <p><strong>Update:</strong> I added the "ruby" tag because puppet has so few followers. If this doesn't belong in ruby, or if you know a better tag for it, let me know.</p>
  
  <p><strong>Update again:</strong> Having learned some more about puppet, I now understand that this message is coming from the component called "Facter" that sniffs out "facts" about the system that Puppet is running on. I found some configuration options and played around with <a href="http://docs.puppetlabs.com/references/stable/configuration.html#certname" rel="noreferrer">"certname"</a>, <a href="http://docs.puppetlabs.com/references/stable/configuration.html#nodename" rel="noreferrer">"node_name"</a> and <a href="http://docs.puppetlabs.com/references/stable/configuration.html#nodenamevalue" rel="noreferrer">"node_name_value"</a>, but I couldn't get the delay to go away. Does anyone know specifically how to either tell Facter to ignore the fqdn or how to make Facter able to find the fqdn on an Ubuntu 11.10 vm?</p>
  
  <p><strong>Progress:</strong></p>
  
  <pre><code>$ cat /etc/resolv.conf
  # Generated by NetworkManager
  nameserver 192.168.1.1
  </code></pre>
  
  <p>That's my router, which is running Dnsmasq via Tomato.</p>
  
  <pre><code>$ dig -x 192.168.1.129 192.168.1.1
  
  ; &lt;&lt;&gt;&gt; DiG 9.7.3 &lt;&lt;&gt;&gt; -x 192.168.1.129 192.168.1.1
  ;; global options: +cmd
  ;; Got answer:
  ;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: NOERROR, id: 21838
  ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
  
  ;; QUESTION SECTION:
  ;129.1.168.192.in-addr.arpa.    IN  PTR
  
  ;; ANSWER SECTION:
  129.1.168.192.in-addr.arpa. 0   IN  PTR desk-vm-ubuntu-beta.
  
  ;; Query time: 14 msec
  ;; SERVER: 192.168.1.1#53(192.168.1.1)
  ;; WHEN: Sun Oct 16 17:47:47 2011
  ;; MSG SIZE  rcvd: 77
  
  ;; Got answer:
  ;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: NOERROR, id: 27462
  ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
  
  ;; QUESTION SECTION:
  ;192.168.1.1.           IN  A
  
  ;; ANSWER SECTION:
  192.168.1.1.        0   IN  A   192.168.1.1
  
  ;; Query time: 11 msec
  ;; SERVER: 192.168.1.1#53(192.168.1.1)
  ;; WHEN: Sun Oct 16 17:47:47 2011
  ;; MSG SIZE  rcvd: 45
  </code></pre>
  
  <p><code>strace</code> led me to arp, which was blocking for 5 seconds and called twice for each <code>facter</code>:</p>
  
  <pre><code>$ time arp -a
  ? (10.0.2.2) at 52:54:00:12:35:02 [ether] on eth0
  
  real    0m5.127s
  user    0m0.004s
  sys     0m0.016s
  </code></pre>
  
  <p>I changed the VM from NAT networking to bridged, so that it now has an IP on the network, and <code>arp</code> returns immediately now. (I'm no networking guru, so I have no idea why this worked, but it seemed a reasonable thing to try.) But <code>facter</code> still takes about 4-5 seconds total to run and still reports "Could not retrieve fact fqdn". <code>facter -d</code> shows several occurrences of "value for domain is still nil", all the way to the end. I'm thinking something still isn't quite right.</p>