We will demonstrate two methods for resolving the issue, using SSH access and sFTP access.
We will use the Nano utility to view and edit the resolv.conf file, where the DNS configuration of our server is set. Enter the following command:
The resolv.conf file editor will open in front of us. The file may be empty, or it may contain text in the form of a description, depending on the chosen Linux distribution. In this file, you need to specify the nameserver for your OS. Which nameserver to choose? You can read about it in detail at the end of this article. In this case, we will use Google's DNS 126.96.36.199 as the primary one. Add the following text to the file:
Press the Ctrl + X key combination to exit the file. Then press Y to save the changes. Finally, press Enter to keep the file name the same.
Connect to our server via sFTP. Next, navigate to the /etc directory and find the resolv.conf file there. Open it with any text editor. The file may be empty, or it may contain text in the form of a description, depending on the chosen Linux distribution. We need to add the optimal nameservers here, specifying several of them in case of problems with one of them.
Great, save the file and upload it to the server.