<p>it there for Kubernetes an option to set a DNS alias as in can be done within a host file (62.116.156.20 servera)? Where servera is an external server. As a result any pod within the cluster can get in contact to server via DNS.</p>
<p>Thanks</p>

Christian V
<p>It totally depends how you configure and deploy your pods. There is an option to add a custom DNS entry to the host file of every pod documented here: <a href="https://kubernetes.io/docs/tasks/network/customize-hosts-file-for-pods/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/network/customize-hosts-file-for-pods/</a></p>
<p>configuration snip:</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: hostaliases-pod
spec:
  restartPolicy: Never
  hostAliases:
  - ip: &quot;127.0.0.1&quot;
    hostnames:
    - &quot;foo.local&quot;
    - &quot;bar.local&quot;
  - ip: &quot;10.1.2.3&quot;
    hostnames:
    - &quot;foo.remote&quot;
    - &quot;bar.remote&quot;
  containers:
  - name: cat-hosts
    image: busybox:1.28
    command:
    - cat
    args:
    - &quot;/etc/hosts&quot;
</code></pre>
