Change cloud server DNS servers
Selectel's DNS servers are automatically writed in the cloud server settings: 188.93.16.19
and 188.93.17.19
You can change the DNS servers in different ways depending on whether you want to disable network configuration via cloud-init:
- if you do not want to disable network configuration via cloud-init: change DNS servers on private subnet or disable DNS configuration via cloud-init;
- or disable-network-configuration-via-cloud-init and configure the network manually.
The network settings are synchronized using the cloud-init utility, so if you change the DNS servers in the network settings configuration files, the Selectel DNS servers will be specified again when the cloud server is rebooted.
Change DNS servers on the private subnet
After changing the DNS servers, cloud-init will automatically write the new DNS servers in all cloud server configuration files on the private subnet. New DNS servers will automatically be specified for all new cloud servers on this private subnet.
If the subnet where the cloud server resides is part of a global router network, create a ticket to change the DNS servers.
-
Delete Selectel DNS server information:
openstack subnet set --no-dns-nameservers <subnet_id>
Specify
<subnet_id>
— private subnet ID, can be viewed withopenstack subnet list
-
Install new DNS servers:
openstack subnet set <subnet_id> --dns-nameserver <dns_1> --dns-nameserver <dns_2>
Specify
<dns_1>
and<dns_2>
as the new DNS servers. -
Look at the subnet properties and verify that the DNS server information has been updated:
openstack subnet show <subnet_id>
Disable DNS configuration via cloud-init
cloud-init will continue to configure the network, but will not configure DNS servers.
-
Open the
/etc/systemd/resolved.conf
file:nano /etc/systemd/resolved.conf
-
Install new DNS servers:
[Resolve]
DNS=<dns_1> <dns_2>Specify
<dns_1>
and<dns_2>
as the new DNS servers. -
Create a symbolic link to the file:
ln -svi /run/system/resolve/resolv.conf /etc/resolv.conf
-
Enable the
system-resolved
service (DNS resolver):systemctl enable system-resolved
-
Verify that the DNS server information is updated in the /etc/resolv.conf file:
system-resolve --status
Disable network configuration via cloud-init
You can disable configuring network settings (including DNS) via cloud-init and set all settings manually.
In the instructions, we look at an example for Ubuntu.
-
Create a file
/etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
with the contents"network: {config: disabled}"
:echo "network: {config: disabled}" > /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
-
Set up the network manually. Replace DNS servers or other parameters with the desired ones manually in the
/etc/network/interfaces
file or use the configuration that was previously created via cloud-init:mv /etc/network/interfaces.d/50-cloud-init.cfg /etc/network/interfaces