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.
- Install OpenStack CLI and complete authentication if not done so already.
- Go to your VK Cloud management console.
- Go to Containers → Kubernetes Clusters.
- Click the name of the cluster that you want to change DNS settings.
- On the General Information tab, find out the name of the network and subnet where the cluster is located.
- Contact your DNS provider for the IP addresses of the DNS servers that should be used instead of those assigned to the cluster.
-
Get the ID of the subnet you want to edit:
openstack subnet list -
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. -
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-nameserverparameter 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>
To apply the changes:
-
Stop your cluster and wait for all nodes to completely shut down.
-
Start the cluster again and wait for all nodes to initialize.
When the cluster starts, all its nodes will receive updated DNS settings.