Changing the DNS servers of Public Cloud instances
Find out how to change the default DNS servers on a Public Cloud instance
Objective
The default DNS server configured on instances you create will be the OVHcloud server (213.186.33.99 for example). You can add a secondary server or replace this configuration with your own. However, the DNS servers are configured automatically by a DHCP server and you will not be able to change the DNS configuration by editing the resolv.conf file.
This guide explains how to change the DHCP configuration of an instance in order to change the DNS servers.
OVHcloud is providing you with services for which you are responsible, with regard to their configuration and management. You are therefore responsible for ensuring they function correctly.
This guide is designed to assist you in common tasks as much as possible. Nevertheless, we recommend that you contact a specialist service provider if you have difficulties or doubts concerning the administration, usage or implementation of services on a server.
Requirements
- A Public Cloud instance in your OVHcloud account
- Administrative access to the instance via SSH or RDP
- Basic networking and administration knowledge
OVHcloud Control Panel Access
- Direct link:
- Navigation path:
Public Cloud> Select your project
Instructions
Log in to your instance via SSH. Refer to our guide on Connecting to a Public Cloud instance if necessary.
Using a text editor of your choice, edit the file /etc/dhcp/dhclient.conf to configure the DNS servers you want.
Replace IP1 and IP2 with the IP addresses of your DNS servers, then use the directive that fits your needs:
- To replace the server configured by default:
- To prefer your DNS servers over the default one:
- To use your DNS servers only if the default one is unavailable:
Save the file, then check that the configuration has been applied properly:
Go further
First steps with Public Cloud instances
Changing the hostname of a Public Cloud instance
Join our community of users.


