Azure app service - DNS service issue

nirmal kumar 1 Reputation point
2024-03-28T12:11:32.76+00:00

I have an azure app service hosted in Linux container.

I want this app service to use particular dns server. The app service is not integrated with vnet.

So, I used app settings environment variables

WEBSITE_DNS_SERVER

WEBSITE_DNS_ALT_SERVER

But app service is not using this DNS service set in app settings

when I do nslookup from kudo console. It’s using the name server specified in resolve.conf file.

the name server set in resolve.conf is 127.0.0.11

any way to resolve this issue. And also when we try to resolve cname entries not able to resolve.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,878 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Andriy Bilous 10,901 Reputation points MVP
    2024-03-29T22:13:33.14+00:00

    Hello nirmal kumar

    If you aren't integrating your app with a virtual network and custom DNS servers aren't configured, your app uses Azure DNS. If you integrate your app with a virtual network, your app uses the DNS configuration of the virtual network. The default for virtual network is also to use Azure DNS. Through the virtual network, it's also possible to link to Azure DNS private zones and use that for private endpoint resolution or private domain name resolution.

    When your app needs to resolve a domain name using DNS, the app sends a name resolution request to all configured DNS servers. If the first server in the list returns a response within the timeout limit, you get the result returned immediately. If not, the app waits for the other servers to respond within the timeout period and evaluates the DNS server responses in the order you configured the servers. If none of the servers respond within the timeout and you configured retry, you repeat the process.

    Configuring DNS servers

    The individual app allows you to override the DNS configuration by specifying the dnsServers property in the dnsConfiguration site property object. You can specify up to five custom DNS servers. You can configure custom DNS servers using the Azure CLI:

    Azure CLI

    az resource update --resource-group <group-name> --name <app-name> --resource-type "Microsoft.Web/sites" --set properties.dnsConfiguration.dnsServers="['168.63.129.16','xxx.xxx.xxx.xxx']"
    

    App Service has existing app settings to configure DNS servers and name resolution behavior. Site properties override the app settings if both exist. Site properties have the advantage of being auditable with Azure Policy and validated at the time of configuration. We recommend you to use site properties.

    You can still use the existing WEBSITE_DNS_SERVER app setting, and you can add custom DNS servers with either setting. If you want to add multiple DNS servers using the app setting, you must separate the servers by commas with no blank spaces added.

    Using the app setting WEBSITE_DNS_ALT_SERVER, you appends the specific DNS server to the list of DNS servers configured. The alternative DNS server is appended to both explicitly configured DNS servers and DNS servers inherited from the virtual network.
    https://learn.microsoft.com/en-us/azure/app-service/overview-name-resolution

    0 comments No comments

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more