# Basic nslookup functionality

**URL:** <https://forum.ansible.com/t/basic-nslookup-functionality/25812>\
**Category:** Ansible Project\
**Created:** [October 24, 2017, 5:45pm UTC](https://forum.ansible.com/t/basic-nslookup-functionality/25812 "2017-10-24T17:45:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![plavmark](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@plavmark](https://forum.ansible.com/u/plavmark)\
**Post date:** [October 24, 2017, 5:45pm UTC](https://forum.ansible.com/t/basic-nslookup-functionality/25812/1 "2017-10-24T17:45:42Z")

</div>

Hi,

In my inventory file I have the following content, e.g.

[subnets]  
8.8.4.4  
8.8.8.8

Now in the playbook I want to resolve DNS for this IP and save it back into another file (that will be used as input for another playbook).  
So I started with the following (introduced extra fact to keep it simple, not sure if this is correct approach):

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [October 24, 2017, 8:21pm UTC](https://forum.ansible.com/t/basic-nslookup-functionality/25812/2 "2017-10-24T20:21:49Z")

</div>

It might be possible for you to use the dig lookup plugin to get information from dns. Seehttps://docs.ansible.com/ansible/devel/plugins/lookup/dig.html

Hope this helps,

Jon
