Set DNS through SSH

Add name servers to the configuration file
 
On Linux, the DNS servers that the system uses for name resolution are defined in the /etc/resolv.conf file. That file should contain at least one nameserver line. Each nameserver line defines a DNS server.
 
The name servers are prioritized in the order the system finds them in the file. Use the IP addresses of the name servers when entering them, because the system won’t know what to do with domain names
until after it knows how to get to the DNS servers.

Open the resolv.conf file with an editor, such as nano, to make the necessary changes (if it doesn’t exist already, this command creates the file).

     #sudo nano /etc/resolv.conf

Modify or enter the nameserver as follows:

       nameserver IP-ADDRESS
       nameserver IP-ADDRESS

Save and close the file. To test DNS configuration type any one of the following commands:

       $ host google.com

If you see valid output such as actual IP address or are able to ping to a remote server via hostname, it means that the DNS is working for you
  • 117 Korisnici koji smatraju članak korisnim
Je li Vam ovaj odgovor pomogao?

Vezani članci

Install RootKit Hunter(rkhunter) on CentOS

Rootkit Hunter(rkHunter) is a unix-based tool that scans for rootkits, backdoors, and possible...

Steps to Install Wordpress on CentOS

How to Install WordPress on CentOS WordPress is a popular free open-source website and blogging...

Update cPanel license key via SSH

If you have purchased Managed VPS hosting service with us, Our dedicated management team will...

What is Console Access?

The serial console is a SolusVM feature that enables an SSH connection through a separate IP...