Azure private DNS resolve in AKS

Nikos Fotiou 0 Reputation points


I have created some private dns records, which cannot be resolved neither from an Azure VM nor from AKS.

I have added the following nameserver IPs in the virtual network dns_servers attribute:

["", "", "", ""]

However I had to make changes to the resolv.conf of the vm to resolve it correctly.

For AKS do I need to add configuration in my containers to make them resolv the provate dns?

Could this be a firewall issue?

A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.
1,064 questions
Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
1,981 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Prrudram-MSFT 22,976 Reputation points

    Hello @Nikos Fotiou

    To resolve private DNS records from an Azure VM, you can add the IP address of the custom DNS server to the virtual network's DNS server list. You can also configure the VM's network interface to use the custom DNS server.

    For AKS, you can configure the cluster to use a custom DNS server by specifying the dnsConfig field in the AKS cluster configuration. You can also configure the DNS server for individual pods by specifying the dnsConfig field in the pod specification.

    If you are still unable to resolve private DNS records, it could be a firewall issue. Ensure that firewall rules allow traffic to and from the custom DNS server and the VM or AKS cluster. You can also check the DNS server logs for any errors or issues.

    If this does answer your question, please accept it as the answer as a token of appreciation.

  2. Andrei Barbu 2,581 Reputation points Microsoft Employee

    Hello Nikos Fotiou,

    If by private DNS records you mean record in an Azure Private DNS Zone, for AKS to be able to resolve that, you will need to add a Virtual Network Link for AKS's VNET in the Azure Private DNS Zone.

    If you want AKS to resolve some specific IPs as per your configuration, you can customize CoreDNS.

    Hopefully this is what you are looking for! If you have additional questions, please let us know in the comments.

    If this has been helpful, please take a moment to accept answers as this helps increase visibility of this question for other members of the Microsoft Q&A community. Thank you for helping to improve Microsoft Q&A!

    0 comments No comments