# Failed to add a custom host

**URL:** <https://forums.suse.com/t/failed-to-add-a-custom-host/9957>\
**Category:** Rancher 1.x\
**Created:** [April 3, 2018, 8:02am UTC](https://forums.suse.com/t/failed-to-add-a-custom-host/9957 "2018-04-03T08:02:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Flora\_Zhang](https://avatars.discourse-cdn.com/v4/letter/f/c68b51/32.png) [@Flora\_Zhang](https://forums.suse.com/u/Flora_Zhang)\
**Post date:** [April 3, 2018, 8:02am UTC](https://forums.suse.com/t/failed-to-add-a-custom-host/9957/1 "2018-04-03T08:02:03Z")

</div>

I run the Rancher server on a virtual machine with ubuntu 16.04, and it works well.  
When I want to add a custom agent with another virtual machine which runs on the same physical machine, it failed.  
It shows good when I used the copied command to run a rancher-agent

INFO: Launched Rancher Agent: 85f29dde8a3816376f2ca22d5c24dab10ce824d9493ff87ab331cb8e4132935b

But I can’t see my host shown in the Web UI,so I tried to see the logs of the rancher-agent. Then I find out the error:

ERROR: DNS Checking loopback IP address 127.0.0.0/8, localhost or ::1 configured as the DNS server on the host file /etc/resolv.conf, can’t accept it

I wonder how to solve this problem. It also occur in the situation of adding the server as a custom host.

---

<div class="post-metadata">

**Author:** ![superseb](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/superseb/32/2424_2.png) [@superseb](https://forums.suse.com/u/superseb)\
**Post date:** [April 3, 2018, 10:01am UTC](https://forums.suse.com/t/failed-to-add-a-custom-host/9957/2 "2018-04-03T10:01:57Z")

</div>

The error is described here: [http://rancher.com/docs/rancher/v1.6/en/faqs/agents/#reference-to-localhost-present-in-etcresolvconf](http://rancher.com/docs/rancher/v1.6/en/faqs/agents/#reference-to-localhost-present-in-etcresolvconf)

In v1.6.15 you can add `-e CATTLE_CHECK_NAMESERVER=false` to ignore the check.

---

<div class="post-metadata">

**Author:** ![vincent](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/vincent/32/7156_2.png) [@vincent](https://forums.suse.com/u/vincent)\
**Post date:** [April 4, 2018, 3:03am UTC](https://forums.suse.com/t/failed-to-add-a-custom-host/9957/3 "2018-04-04T03:03:40Z")

</div>

I think their instructions are outdated and it’s systemd providing the dns server instead of dnsmasq (maybe not in 16.04 but in newer versions). But the easiest thing to do is just give a list to docker instead of messing with the host config.

---

<div class="post-metadata">

**Author:** ![Flora\_Zhang](https://avatars.discourse-cdn.com/v4/letter/f/c68b51/32.png) [@Flora\_Zhang](https://forums.suse.com/u/Flora_Zhang)\
**Post date:** [April 8, 2018, 11:43am UTC](https://forums.suse.com/t/failed-to-add-a-custom-host/9957/4 "2018-04-08T11:43:37Z")

</div>

After I follow the instructions and finish the editing, the problem is still there…
