VK Cloud logo

Changing DNS server addresses in cluster network

This article shows an example of changing the IP addresses of DNS servers that are used to resolve domain names of hosts in a cluster.

Before you start

  1. Install OpenStack CLI and complete authentication if not done so already.
  2. Go to your VK Cloud management console.
  3. Go to ContainersKubernetes Clusters.
  4. Click the name of the cluster that you want to change DNS settings.
  5. On the General Information tab, find out the name of the network and subnet where the cluster is located.
  6. Contact your DNS provider for the IP addresses of the DNS servers that should be used instead of those assigned to the cluster.

1. Change DNS server addresses in network settings

  1. Get the ID of the subnet you want to edit:

    openstack subnet list
  2. Reset all assigned IP addresses:

    openstack subnet set --no-dns-nameservers <SUBNET_ID>

    Here, <SUBNET_ID> is the ID of the subnet you want to edit.

  3. Specify the new IP address:

    openstack subnet set --dns-nameserver <DNS_ADDRESS> <SUBNET_ID>

    You can specify more than one IP address. In this case, repeat the --dns-nameserver parameter before each address. Following is a command example:

    openstack subnet set --dns-nameserver <DNS_ADDRESS_1> --dns-nameserver <DNS_ADDRESS_2> --dns-nameserver <DNS_ADDRESS_3> <SUBNET_ID>

2. Reboot the cluster

To apply the changes:

  1. Stop your cluster and wait for all nodes to completely shut down.

  2. Start the cluster again and wait for all nodes to initialize.

When the cluster starts, all its nodes will receive updated DNS settings.