Two issues I got on Azure recently

The last day I launched a VM in Azure, with ubuntu 20.04 installed.

The official sources can’t be used at all, any command executed by ‘apt’ will fail.

So I have to use ubuntu’s sources list rather than MS’s. The following are my items in “/etc/apt/sources.list”.

deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse

deb http://archive.canonical.com/ubuntu focal partner
deb-src http://archive.canonical.com/ubuntu focal partner

After then I run ‘apt update && apt upgrade’ to update the system. Now everything works fine.

This VM has a IPv4 assigned. I found that it can not set a reverse DNS (PTR) for this IP in Azure dashboard. Once it was possible to have PTR set in dashboard. But for now you have to make it done in AZ cloud shell by providing the following commands.

az network public-ip update --resource-group tls-mail_group --name tls-mail-ip --reverse-fqdn tls-mail.westus2.cloudapp.azure.com.  --dns-name tls-mail

This is the first setup for PTR, which has 4 arguments required.

  • –resource-group: resource group you created for the application
  • –name: name of IPv4, not the address itself
  • –reverse-fqdn: the reverse DNS (PTR record)
  • –dns-name: the regular DNS (A record)

After then you get a domain name for this IP, which is “tls-mail.westus2.cloudapp.azure.com”. And reverse DNS hostname for the IP is also “tls-mail.westus2.cloudapp.azure.com”. This is good. If you run a mail server on the VM, generally it requires A RR and PTR RR are matched.

How to update the reverse DNS? Just run the following command.

az network public-ip update --resource-group tls-mail_group --name tls-mail-ip --reverse-fqdn tls-mail.westus2.cloudapp.azure.com.

To check the reverse DNS for an IP, just run:

az network public-ip show --name tls-mail-ip --resource-group tls-mail_group

Comment