# Multi-node cluster node hostname resolution problems

**URL:** <https://discuss.kubernetes.io/t/multi-node-cluster-node-hostname-resolution-problems/14640>\
**Category:** microk8s\
**Created:** [January 31, 2021, 3:42am UTC](https://discuss.kubernetes.io/t/multi-node-cluster-node-hostname-resolution-problems/14640 "2021-01-31T03:42:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kirin\_nee](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/kirin_nee/32/6830_2.png) [@kirin\_nee](https://discuss.kubernetes.io/u/kirin_nee)\
**Post date:** [January 31, 2021, 3:42am UTC](https://discuss.kubernetes.io/t/multi-node-cluster-node-hostname-resolution-problems/14640/1 "2021-01-31T03:42:16Z")

</div>

I set up a multi-node cluster with a private VPC in AWS.

Most things work except when I have to log a pod that is in another node.

`microk8s kubectl`'s control pane API call will use the node’s name (for example `ip-10-0-0-206` ), which will fail resolve as it is not set-up.

May I know how can I change `kubectl`'s behaviour to use the node’s private IP within the VPC and the mechanism which microk8s or `kubectl` use to decide the address to use access a node?

---

<div class="post-metadata">

**Author:** ![balchua1](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/balchua1/32/5372_2.png) [@balchua1](https://discuss.kubernetes.io/u/balchua1)\
**Post date:** [January 31, 2021, 4:43am UTC](https://discuss.kubernetes.io/t/multi-node-cluster-node-hostname-resolution-problems/14640/2 "2021-01-31T04:43:21Z")

</div>

If you can change your `/etc/hosts` to include the node ips, i will go that route.

---

<div class="post-metadata">

**Author:** ![kirin\_nee](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/kirin_nee/32/6830_2.png) [@kirin\_nee](https://discuss.kubernetes.io/u/kirin_nee)\
**Post date:** [February 1, 2021, 3:46pm UTC](https://discuss.kubernetes.io/t/multi-node-cluster-node-hostname-resolution-problems/14640/3 "2021-02-01T15:46:14Z")

</div>

if i were to automate the creation of the cluster (via terraform or otherwise), how to i ensure it works out of the box? I would it to be configured by default to work, without manually configuring the dns 😕 or is this an AWS setup issue? :o

---

<div class="post-metadata">

**Author:** ![balchua1](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/balchua1/32/5372_2.png) [@balchua1](https://discuss.kubernetes.io/u/balchua1)\
**Post date:** [February 1, 2021, 9:53pm UTC](https://discuss.kubernetes.io/t/multi-node-cluster-node-hostname-resolution-problems/14640/4 "2021-02-01T21:53:12Z")

</div>

I use terraform to bootstrap a cluster. Well i also use terraform to add the node names to etc/hosts. Perhaps not the most elegant.

Shameless plug.

> **[balchua/do-microk8s](https://github.com/balchua/do-microk8s)**
>
> Bootstrap Microk8s cluster on DIgitalocean. Contribute to balchua/do-microk8s development by creating an account on GitHub.
