# Having problem in reverse mapping of hostname to ip address using DNS filter

**URL:** <https://discuss.elastic.co/t/having-problem-in-reverse-mapping-of-hostname-to-ip-address-using-dns-filter/97769>\
**Category:** Logstash\
**Created:** [August 21, 2017, 1:01pm UTC](https://discuss.elastic.co/t/having-problem-in-reverse-mapping-of-hostname-to-ip-address-using-dns-filter/97769 "2017-08-21T13:01:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ram\_Prasath](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ram_prasath/32/45614_2.png) [@Ram\_Prasath](https://discuss.elastic.co/u/Ram_Prasath)\
**Post date:** [August 21, 2017, 1:01pm UTC](https://discuss.elastic.co/t/having-problem-in-reverse-mapping-of-hostname-to-ip-address-using-dns-filter/97769/1 "2017-08-21T13:01:35Z")

</div>

I am trying to use the DNS filter to map the hostname to IPaddress , below is the sample configuration I tried to map [google.com](http://google.com) to ipaddress

```
filter{
    mutate {
    add_field => {"hostname", "google.com"}
    }
   
   dns {
   reverse => ["hostname"]
   action => "replace"
   nameserver => ["8.8.8.8", "8.8.4,4"]
   timeout => 10.0 #Just to make sure timeout is not the problem here
   }
}

```

the hostname does not translate to ip address , let me know what i am doing wrong here

---

<div class="post-metadata">

**Author:** ![rcowart](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rcowart/32/88091_2.png) [@rcowart](https://discuss.elastic.co/u/rcowart)\
**Post date:** [August 21, 2017, 1:47pm UTC](https://discuss.elastic.co/t/having-problem-in-reverse-mapping-of-hostname-to-ip-address-using-dns-filter/97769/2 "2017-08-21T13:47:39Z")

</div>

You have it the wrong way around...

`reverse` takes an IP address and looks up its name.  
`resolve` takes a name and looks up its IP address.

---

<div class="post-metadata">

**Author:** ![Ram\_Prasath](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ram_prasath/32/45614_2.png) [@Ram\_Prasath](https://discuss.elastic.co/u/Ram_Prasath)\
**Post date:** [August 21, 2017, 3:13pm UTC](https://discuss.elastic.co/t/having-problem-in-reverse-mapping-of-hostname-to-ip-address-using-dns-filter/97769/3 "2017-08-21T15:13:26Z")

</div>

Thanks a lot

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 18, 2017, 3:13pm UTC](https://discuss.elastic.co/t/having-problem-in-reverse-mapping-of-hostname-to-ip-address-using-dns-filter/97769/4 "2017-09-18T15:13:29Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
