ExternalName in managed kubernetes; Host not resolve

Asking for help? Comment out what you need so we can get more information to help you!

Cluster information:

Kubernetes version: 1.28
Cloud being used: bare-metal
Installation method: Kubeadm init
Host OS: Ubuntu
CNI and version:
CRI and version: CRIO on proxy

Hi everyone, As in above image , I have a managed k8s v 1.28 running on a Ubuntu PC. I have some web api available in another machine. This is a intranet network. Typicaly i modify /etc/hosts file and api are able to connect to IIS via custom domain.

In this senario, I created below external service

apiVersion: v1
kind: Service
  name: external-api
  namespace: demo
  type: ExternalName

I also created a ConfigMap, Now i removed this

apiVersion: v1
kind: ConfigMap
  name: custom-dns-config
  namespace: demo
  Corefile: |
    .:53 {
        kubernetes cluster.local in-addr.arpa ip6.arpa {
          pods insecure
          upstream /etc/resolv.conf
          fallthrough in-addr.arpa ip6.arpa
        prometheus :9153
        forward . /etc/resolv.conf
        cache 30
        hosts {

still when in do kubectl exec -it poda -- nslookup nodea.dev It is not able to resolve. Since this is a managed K8s, do i need to modify coredns directly, but how can i automate later ?

This is how it used in code


I expect https://nodea.dev should be resolved inside pod

Since external IP and domain name are dynamic depends on env, I want to convert this total solution to a helm chart eventualy and read the external ip and custom domain from values.yaml file.

Thank you for time and consideration. Any comments are helpfull. Thank you

Have you considered below option?

It should do the trick