# DNS lookup failure: host in /etchosts

**URL:** <https://discuss.elastic.co/t/dns-lookup-failure-host-in-etchosts/49111>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [May 3, 2016, 9:39pm UTC](https://discuss.elastic.co/t/dns-lookup-failure-host-in-etchosts/49111 "2016-05-03T21:39:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![carrot](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carrot/32/44335_2.png) [@carrot](https://discuss.elastic.co/u/carrot)\
**Post date:** [May 3, 2016, 9:39pm UTC](https://discuss.elastic.co/t/dns-lookup-failure-host-in-etchosts/49111/1 "2016-05-03T21:39:04Z")

</div>

I provisioned the destination hostname in /etc/hosts for testing, but looks like filebeat doesn't honor /etc/hosts entries... Just asking first before putting a bug. Seems like it's not using the normal Linux resolvers.

016-05-03T20:57:32Z WARN DNS lookup failure "[test.example.net](http://test.example.net)": lookup [test.example.net](http://test.example.net) on x.x.x.x:53: no such host

[root]# cat /etc/hosts  
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4  
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.0.50 [test.example.net](http://test.example.net)

---

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [May 4, 2016, 1:43am UTC](https://discuss.elastic.co/t/dns-lookup-failure-host-in-etchosts/49111/2 "2016-05-04T01:43:59Z")

</div>

I have used /etc/hosts for defining hostnames resolved by Beats.

You can enable debug for Go's DNS resolution so you can see what decisions it's making.

```auto
export GODEBUG=netdns=2
./filebeat -c myconfig -e -v
go package net: dynamic selection of DNS resolver
go package net: hostLookupOrder(test123.example.com) = files,dns

```

The name resolution behavior of Go is described [here](https://golang.org/pkg/net/#hdr-Name_Resolution).

---

<div class="post-metadata">

**Author:** ![carrot](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carrot/32/44335_2.png) [@carrot](https://discuss.elastic.co/u/carrot)\
**Post date:** [May 4, 2016, 3:55pm UTC](https://discuss.elastic.co/t/dns-lookup-failure-host-in-etchosts/49111/3 "2016-05-04T15:55:01Z")

</div>

I can't reproduce anymore. This works just fine.

---

<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:** [July 5, 2017, 9:52pm UTC](https://discuss.elastic.co/t/dns-lookup-failure-host-in-etchosts/49111/4 "2017-07-05T21:52:22Z")

</div>


