Introduction
This article guides you on how to change the nameservers configured in /etc/resolv.conf
via WHM or SSH.
Procedure
WHM
1. Log in to WHM.
2. Navigate to Resolver Configuration.
3. Select Proceed.
4. Make the desired changes.
5. Select Continue to save the changes.
SSH
1. Connect to the server via SSH as the root user.
2. Open the /etc/resolv.conf
file using your preferred command-line text editor (for example, vi
, vim
, nano
, etc.)
3. Comment out the current nameservers by adding a #
in front of each nameserver, then add the new nameserver entries or modify the file as needed.
Example: (Note the below example uses Google's public DNS servers 8.8.8.8 and 8.8.4.4. Please keep in mind that using public DNS servers may cause RBL's such as Spamhaus to not function correctly.)
#nameserver 192.168.0.1
#nameserver 192.168.0.2
nameserver 8.8.8.8
nameserver 8.8.4.4
4. Save and close the file.