"I'm encountering an error when trying to connect to my AKS cluster: dial tcp: lookup nslnew-75778846.hcp.eastus.azmk8s.io on 127.0.0.53:53: no such host.

nslaksauto 0 Reputation points
2024-10-17T18:31:14.4333333+00:00

Title: Kubernetes Cluster Connectivity Issue: Unable to Reach API Server

Hi Azure Support Team,

I'm experiencing a connectivity issue with my AKS cluster. When I try to interact with the Kubernetes API, I receive the following error:

dial tcp: lookup nslnew-75778846.hcp.eastus.azmk8s.io on 127.0.0.53:53: no such host

Here are the details of my setup:

  • Azure service: AKS
  • Current context set to my cluster: nsl-clusternew
  • Configuration: I'm using Terraform to manage my resources.

I have tried updating my kubeconfig and ensuring that my network settings are correct, but the issue persists.

Could you please assist me in troubleshooting this connectivity issue?

Thank you!

Lalitha

8555010300

Azure Kubernetes Service
Azure Kubernetes Service
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,448 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Anusree Nashetty 4,380 Reputation points Microsoft External Staff Moderator
    2024-10-18T10:39:43.4+00:00

    Hi nslaksauto,

    I have shared troubleshooting steps that I felt will help resolve the issue you reported.

    Check that your AKS cluster is running and healthy. You can do this by running the following command, this will tell the provisioning state of your AKS cluster. If the state is Succeeded, then your AKS cluster is running and healthy:

    az aks show --resource-group <resource-group-name> --name <aks-cluster-name> --query 'provisioningState'

    Check that your DNS settings are correct. This below command will list all the services in your AKS cluster. Make sure that the kube-dns service is running and healthy.

    kubectl get svc --all-namespaces
    

    Try updating Kubeconfig: az aks get-credentials --resource-group <resource-group> --name <cluster-name>

    If your AKS cluster is public, DNS should resolve directly via Azure's public DNS. If it is private, ensure that you're using private DNS correctly, and that your local network has access to the Azure Private Link endpoints. If it returns true, it means you're using a private cluster, which requires specific VNet and DNS configurations

    az aks show --resource-group <resource-group> --name <cluster-name> --query "apiServerAccessProfile.enablePrivateCluster"
    

    If you still find any difficulties, please let me know I would like to work closer on this issue.

    Thank you.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.