Multiple DNS Names for a public IP in Azure AKS

12/29/2019

I'm trying to setup a K8 ingress to route to multiple services based on the hostname. Like mentioned here.

In Azure, I'm able to map DNS name with Public IP using az-cli like this,

az network public-ip update --ids $PUBLICIPID --dns-name $DNSNAME

However, this command isn't letting me to add multiple DNS entries to the same publicIP.

What will be the right way to achieve this in Azure KS? Preferably using az-cli or some other cli tools.

-- Prasanna
azure
azure-aks
dns
kubernetes
kubernetes-ingress

1 Answer

12/29/2019

I dont think you can assign multiple Azure managed DNS names to the same public IP, but you can use Azure DNS or some external DNS provider to have as many CNAME records pointing to the same DNS record as you want to.

az network dns record-set cname set-record --resource-group myresourcegroup --zone-name contoso.com --record-set-name test-cname --cname www.contoso.com

an alternative would be to use external dns to let kubernetes manage it.

-- 4c74356b41
Source: StackOverflow