Azure DNS (reddog.microsoft.com) 10.0.1.4 Virtual Machine Template - azure

I'm using a template to deploy an elastic cluster and am having issues with the nodes setting up/deploying correctly when I choose my own subnet. It seems this is due to how the Virtual machines by default seem to have a DNS record for their private IP address. But In my case this isn't happening.
Azure DNS (reddog.microsoft.com) 10.0.1.4
What is this DNS server?
Where is it hosted?
Is it automatically deployed to every VPN?
Why do some machines automatically get a record entry and others not?
How can I ensure that machines get an entry?
I am currently trying to use a template to deploy Elasticsearch. If I deploy elasticsearch by creating a subnet during deployment then I get host entries on each ubuntu VM in /etc/hosts and also an A-Record for each VM in this DNS server. The deployment is successful.
If however I choose for the template to deploy in my own subnet I find that the machines don't have each other in /etc/hosts and the DNS server doesn't contain an A-Record and therefore can't resolve each other via name. Deployment therefore fails.
The template I am deploying via the Azure portal UI:
Elastic Stack - (Elasticsearch, Kibana, X-Pack)
Any help appreciated,
Thank you

based on the IP and the dns search suffix, that a custom DNS server. The would be configured as part of the virtual network properties or as part of the dns settings on the individual NIC.

Related

Cannot access Private AKS cluster from Local Machine (on home network) connected to Azure VPN

I have a Private AKS cluster deployed in a VNET on Azure. Once I deployed it, a private endpoint and a private DNS zone were created by default therefore making the cluster accessible from VM's which are part of the same VNET. (I have a VM deployed in the same VNET as the AKS cluster and "kubectl" commands work in it.)
My requirement is that I want to perform the "kubectl" commands from my local machine (connected to my home network) and also connected to the VPN which connects to the VNET.
My machine can talk to resources within the VNET but cannot seem to resolve the FQDN of the private cluster.
I read somewhere that having a DNS forwarder setup in the same VNET can help resolve the DNS queries made from the local machine which can then be resolved by Azure DNS. Is this the way to go about this? Or is there a better way to solve this problem?
It would really help if someone could give me an action plan to follow to solve this problem.
The better way to perform the "kubectl" commands from your local machine to your private AKS cluster is to use AKS Run Command (Preview). This feature allows you to remotely invoke commands in an AKS cluster through the AKS API. This feature provides an API that allows you to, for example, execute just-in-time commands from a remote laptop for a private cluster. Before using it, you need to enable the RunCommandPreview feature flag on your subscription and install aks-preview extension locally. However, there is a limitation that AKS-RunCommand does not work on clusters with AKS managed AAD and Private link enabled.
In this case, If you want to resolve the FQDN of the private cluster from your on-premise network, you could select to use either the hosts file locally(used for testing) or use your DNS forwarder to override the DNS resolution for a private link resource like this.
The DNS forwarder will be responsible for all the DNS queries via a server-level forwarder to the Azure-provided DNS 168.63.129.16.You can provision IaaS Windows VM with DNS role or Linux VM with bind configured as a DNS forwarder. This template shows how to create a DNS server that forwards queries to Azure's internal DNS servers for Linux VM. Refer to this for DNS forwarder on Windows VM.
If there is an internal DNS server in your on-premise network. The on-premises DNS solution needs to forward DNS traffic to Azure DNS via a conditional forwarder for your public DNS zones(e.g. {region}.azmk8s.io). The conditional forwarder references the DNS forwarder deployed in Azure. You could read this blog about DNS configuration sections for more details.

Is it possible to create the equivalent of a hosts file in an azure web app

I'm migrating asp.net services that used to exist on a physical server on-premise to Azure. However they need to reach some web-services (SOAP) that will not be migrated to azure yet. These have a public IP but I need to set the hostname in order for IIS to properly redirect the requests to the correct service as there are several on the same server. Is there any way to create some sort of DNS-server in azure that is only available for the services created in azure that can resolve to the public IP-address outside of azure? (We have used the hosts file on the servers to achieve this previously)
I tried using the private DNS Zones, but as I've understood it they can only point to other azure services within the same vnet (correct me if I'm wrong). I've also tried creating a dnsmasq docker container. However, as this is running in a Linux container, it seems that I cannot put it in the same vnet as the asp.net app services. Thus I am unable to retrieve a private IP-address that these services can use to reach the DNS server.
In my understanding it is now possible to use Azure DNS Private Zones if you want.
You would need to use regional vnet integration to point your app's traffic to a vnet that is connected to the Private Zone. You need the following settings as well, which mean that all outbound traffic from the Web App is routed through the integrated vnet first, and that the Azure default DNS server is used for DNS.
WEBSITE_DNS_SERVER with value 168.63.129.16
WEBSITE_VNET_ROUTE_ALL with value 1
https://learn.microsoft.com/en-us/azure/app-service/web-sites-integrate-with-vnet#azure-dns-private-zones
If you don't want to use Azure DNS Private Zones, I think you can achieve similar results by directing the Web App to use a specific DNS server. This can be done using WEBSITE_DNS_SERVER and WEBSITE_DNS_ALT_SERVER app settings (the values are the IP addresses of the servers you want to use).
This is the most authoritative public statement I can find about using these settings.
Go to the web app->settings->Application Settings-> App Settings
section
Add the following: (WEBSITE_NODE_DEFAULT) should already be
there.
a. WEBSITE_DNS_SERVER with value having the IP address of the
primary DNS server.
b. WEBSITE_ALT_DNS_SERVER (optional), with value
having the IP address of a second DNS server.
Then save the settings & restart webapp in portal.
Double check the web app can actually
connect to the DNS server: a. In kudu console, run: Nameresolver.exe
[hostname-to-lookup] [dns-server-to-use]
First argument should be the
hostname you are trying to look up, second argument is one of the DNS
servers from step 1) If this times out, there is an issue with how
your DNS servers are configured (firewalls, etc.)
https://github.com/MicrosoftDocs/azure-docs/issues/13927#issuecomment-416382230
If using these settings with a DNS server that is only accessible via private IP, you would need to use regional vnet integration again to connect to a vnet. If the DNS server is on-prem, you have to connect through the integrated vnet over VPN or ExpressRoute.
It's possible but not using the private DNS Zone.
According to Name resolution for resources in Azure virtual networks. For the scenario Name resolution from App Service Web Apps in one virtual network to VMs in a different virtual network, you need to use your own DNS servers forwarding queries between virtual networks for resolution by Azure (DNS proxy). See Name resolution using your own DNS server.
In this case, you only allow this azure web service could resolve the public IP address outside of Azure. You could enable virtual network integration for your web app, this restricts your web app access in a private network. Then you could deploy a DNS server in the same Vnet as the web app integrated VNet. You could create an A type record in your DNS zone to point to your service Public IP, then add the DNS server's IP address into the DNS server of the Integrated web app Vnet in the portal. If so, the web app could resolve this public IP via a custom DNS server.
Hope this could help you.

Azure DNS zone record not resolving to specified IP from App service to Virtual Machine

I followed the documentation guide here to configure an Azure DNS zone for a virtual network.
I then created a virtual machine on that virtual network and provisioned a virtual network gateway to allow my Azure web apps to communicate with the virtual machine using VNet integration. My web apps are then able to resolve against the virtual machines private IP as expected.
I then created an 'A' type record set within the DNS zone resolving a service name against the private IP of the virtual machine just like here.
However, when I then attempt to access the DNS configured service name that should resolve against the private IP address of the virtual machine, I get the following error:
curl: (6) Could not resolve host: xxxx.local
Am I missing something obvious here?
I can not reproduce this error following your steps:
Create an Azure VNet with a DNS private zone like private.test.com.
Create a VM and a VPN gateway on that VNet.
Enable VNet integration with my Azure web app service.
My web apps are able to resolve against the virtual machines private IP as expected. This could verify the Azure private DNS zone should work. Then I also create an A record for a custom name against the VM private IP address. Both scenarios work.
You could check if an A record is something like below picture in the private DNS zone.
Then you could verify if curl with http:// or without that, or without the specific port 9200, the error is still the same.
I suggest using SET WEBSITE_DNS_ command. This command will output the current DNS server that is being used by the web app. If the error Environment variable WEBSITE_DNS_ not defined is received, no custom DNS servers are configured for the web app. See more details about networking Related Commands for Azure App Services.

Change DNS suffix on Azure VM

I attempting to deploy a Windows VM in Azure that will be running DNS for resolving a private zone in my VNet. I have created the VNet and set the IP address of the VM as the DNS server for the VNet. Since I have configured the VNet with a private DNS server, the VM gets the placeholder suffix of reddog.microsoft.com. I install DNS on the VM and create my forward and reverse zones. Since the VMs in the VNet will not be domain joined, I configure DDNS to allow unsecure updates. Outside of manually registering a record for the VM running DNS, I am unable to get it to register records. When I try to change the DNS suffix on the NIC, as soon as I click OK on the NIC properties window, my connection is killed and I am no longer able to get back into the VM. The only thing I can do at this point is to destroy it and start over. What am I missing here? Will I have to manually register records for anything I put into the VNet?
Update
From this document about Name resolution that uses your own DNS server:
When you are using Azure-provided name resolution, Azure Dynamic Host
Configuration Protocol (DHCP) provides an internal DNS suffix
(.internal.cloudapp.net) to each VM. This suffix enables hostname
resolution because the hostname records are in the
internal.cloudapp.net zone. When you are using your own name
resolution solution, this suffix is not supplied to VMs because it
interferes with other DNS architectures (like domain-joined
scenarios). Instead, Azure provides a non-functioning placeholder
(reddog.microsoft.com).
It says that your custom DNS suffix is not supplied to VMs because it interferes with other DNS architectures (like domain-joined scenarios). Moreover, Azure doesn't have the credentials to directly create records in your DNS servers. Azure leaves the primary DNS suffix blank, and you can set the suffix in the VM as the picture below:
After changing the DNS suffix, you will restart the VM, then you will see a new DNS suffix in the DNS Suffix Search List in the output of prompt commands.
Go to the DNS server, you will see the DNS records updated. Before this, make sure you have enabled the Nonsecure and secure of the Dynamic updates in the zone properties.

Azure Virtual Network Custom DNS Server

I created a virtual network and put 2 VMs in one subnet. But they were not able to ping each other using their hostnames. I need a DNS Server implemented so that hostnames in the subnet can be resolved to IP addresses. How do I do that? Any help will be appreciated. :)
the simplest scenario is to add your hostnames and ips to your localhost file if you are on Windows or you /etc/resolv.conf if you are on Linux. Deploy your VMs with fixed private IPs to avoid changes if they are rebooted or shutdown.
However, if the scenario is more complex with more than two machines, the best way is to deploy a DNS Server inside your VNET. The steps are the following ones:
First you need to add to your virtual network a DNS. You can do it through the management portal in the section NETWORKS > {Your Network Name} > CONFIGURE > dns servers. Fill it with a name and an IP.
Deploy a new VM inside the Virtual Network and set it's IP to the same IP you have defined inside the portal. You can do it through PowerShell (https://azure.microsoft.com/en-us/documentation/articles/virtual-networks-reserved-private-ip/#how-to-add-a-static-internal-ip-to-an-existing-vm)
Configure your DNS server with the records for the VMs and set the forwarders if you want to be able to resolve names outside the virtual network.
You can reboot your virtual machines to get the new configuration through DHCP.
An example: http://www.ytechie.com/2013/06/setting-up-a-dns-server-in-azure-iaasvms/

Resources