Setting custom DNS suffix on Azure CentOS VMs

Greg Dickinson 1 Reputation point
2021-12-15T13:49:22.463+00:00

I have a few Linux VMs on different VNETs in Azure that I need to do hostname resolution on. For VMs in the same VNET this works using the default settings, obviously. I set up a private DNS zone and linked the VNETs to it, and I can do FQDN DNS resolution between them (hostname.cloud.local) but I need to find a way to add the private DNS suffix to the CentOS configuration. Normally I would just add it to /etc/sysconfig/network but this seems to be overwritten by cloud-init every boot.

I've not used cloud-init much, mainly re-using premade configs. How would I go about adding my private DNS suffix to the networking configuration on these VMs?

Azure DNS
Azure DNS
An Azure service that enables hosting Domain Name System (DNS) domains in Azure.
598 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Arnout Van hulle 1 Reputation point
    2022-02-01T14:45:11.267+00:00

    Hi, I have the same problem. Would there be a way to configure the DNS suffix on Azure CentOS VMs (or Linux VMs in general)? It does indeed look like the network settings are being overwritten by Azure on reboot.

    0 comments No comments