linux DNS modification

one. DNS Pro is modified.

      sudo vi /etc/resolv.conf //Open the resolv.conf file

  Change it to the following:

     nameserver 8.8.8.8 #Modify to your primary DNS

     nameserver 8.8.4.4 #Modify to your alternate DNS

     search localhost #your domain name

This is Google's DNS resolution server. Then save is ok. What server needs to be modified directly. The configuration will take effect in real time, but the configuration may be lost after restarting the system. In fact, when editing this file, you should also be able to see the comment "Do not edit manually" at the head of the file.

It needs to be added directly after the above.

 

two. DNS is permanently modified.

   First execute: sudo -i //Run the login as the target user.

       Then: vi /etc/resolvconf/resolv.conf.d/base

Finally enter: nameserver 8.8.8.8 #Modify to your primary DNS

                  nameserver 8.8.4.4 #Modify to your alternate DNS

After saving, restarting will not fail.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326482774&siteId=291194637