# Resolve DNS / gather\_facts

**URL:** <https://forum.ansible.com/t/resolve-dns-gather-facts/15701>\
**Category:** Ansible Project\
**Created:** [July 18, 2014, 7:25am UTC](https://forum.ansible.com/t/resolve-dns-gather-facts/15701 "2014-07-18T07:25:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nico\_K](https://avatars.discourse-cdn.com/v4/letter/n/46a35a/32.png) [@Nico\_K](https://forum.ansible.com/u/Nico_K)\
**Post date:** [July 18, 2014, 7:25am UTC](https://forum.ansible.com/t/resolve-dns-gather-facts/15701/1 "2014-07-18T07:25:10Z")

</div>

Hi,

I’ve been reading through a lot of posts regarding the subject of “fact gathering” and I’m under the impression that it’s impossible to force fact gathering on hosts when using ‘–limit’?  
My specific use case would be obtaining IP addresses of all hosts to populate the firewall ruleset with.

Ideally I would like to force gathering the facts on a couple of the groups I have defined no matter what the ‘–limit’ is set to.

For the time being, is there a work around? Is there an easy way to resolve a DNS entry?

Thanks,  
Nico

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [July 18, 2014, 11:46am UTC](https://forum.ansible.com/t/resolve-dns-gather-facts/15701/2 "2014-07-18T11:46:04Z")

</div>

You cannot force fact gathering on other hosts not in the limit group when using --limit.

The solution is to not use limit and do something like:

- hosts: all  
gather\_facts: True  
tasks: 

- hosts: “somegroup{{optional\_limit|default(‘’)}}”  
tasks:
