Detailed tutorial on modifying DNS in Linux system

1. Open the terminal

In the Linux system, the method to open the terminal is to press the Ctrl+Alt+T key combination on the keyboard.

2. Enter the network settings

Enter the command "sudo nano /etc/resolv.conf" in the terminal to enter the network settings.

3. Modify the DNS server

Find the "nameserver" option in the editor, here you can set the DNS server. You can add the DNS server address you want to use here, for example:

nameserver 8.8.8.8

nameserver 8.8.4.4

Google DNS: 8.8.8.8 and 8.8.4.4

OpenDNS: 208.67.222.222 and 208.67.220.220

DNSWatch: 84.200.69.80 and 84.200.70.40

4. Save changes

After the modification is complete, press Ctrl+O to save the modification, and then press Ctrl+X to exit the editor.

5. Test DNS resolution

Enter the command "ping www.google.com" in the terminal to test whether the DNS resolution is normal. If "ping: unknown host www.google.com" is displayed, it means that the DNS settings are incorrect.

6. Restart the system

After modifying the DNS, you can restart the Linux system for the modification to take effect. Enter the command "sudo reboot" in the terminal to reboot the system.

For more details visit: www.tsyvps.com

Guess you like

Origin blog.csdn.net/tiansyun/article/details/130263202