Đang Tải...
Typically, your device will use DNS settings configured by your Internet Service Provider (ISP). However, you can proactively change these settings to optimize internet speed or bypass restrictions on certain websites. Check out this article from TotHost to learn how to check and change DNS settings on Linux and Windows servers!
Mục lục
Mục lục
When browsing the internet, in some cases related to internet speed or blocked website access, changing your DNS might be the simplest solution and is very easy for users to implement. TotHost will provide a comprehensive guide on how to change DNS on Windows/Linux servers from A to Z.
First, here is a list of trustworthy DNS addresses you can use:
Next, you need to check your device's DNS before making changes.
If you don’t know how to check the DNS you’re using, follow these methods:
There are various Linux OS versions, so the terminal commands to check DNS may differ. TotHost will guide you through the three most common Linux OS:
For different versions of Ubuntu, the command to use will depend on your system's network configuration. You can use one of the following commands:
or
or
DNS information will be displayed as follows:
On Debian, in addition to the commands used on Ubuntu, you can use:
The commands listed above can also be used with CentOS. Additionally, if you are using Network Manager, you can run the command:
On Windows servers, you can check the DNS settings being used through Command Prompt. Use the key combination Win + R, then type cmd to open Command Prompt.
In the Command Prompt window, type ipconfig/all and press Enter.
The window will display results containing the current DNS Server information.
Once you’ve checked what DNS your device is using, follow these steps to change it:
NOTE: TotHost has already set up a script to change DNS on Linux VPS. You only need to run a single command: ./update_dns.sh
The network configuration file on a Linux server system is usually located in the /etc directory and is named resolv.conf. Therefore, you need to edit this file by opening the Terminal and running the command. You can refer to the TotHost Vietnam YouTube video or follow the steps below:
Type the command:
or
Then press Tab, and the command will automatically add the file 50-cloud-init.yaml.
Proceed to edit by pressing “i” to switch to edit mode (you’ll see the word INSERT at the bottom). Enter the DNS addresses and save by using the command :wq.
Apply the changes to the system with the command:
On Debian, the process is similar to Ubuntu:
You should also press Tab to auto-fill 50-cloud-init.yaml
Follow the same editing steps as for Ubuntu.
Type the command:
Next, use the command:
Edit the DNS address information.
Restart the system with the command:
Open Command Prompt and type netsh to access the configuration state.
Use the command interface show interface to display the necessary DNS information for the changes.
Then, enter interface ip set dns name=[Interface Name] static [DNS Address] and press Enter.
To add a secondary DNS, enter interface ip add dns [Interface Name] [DNS Address] index=2 and press Enter.
Finally, close cmd and restart your computer for the new DNS address to take effect.
Open Settings, select Network & Internet.
Under Ethernet, click on Change Adapter Options.
Right-click on the network you are connected to -> Properties.
Find and select Internet Protocol Version 4 (TCP/IPv4).
Click on Properties to edit the information. Check the box for Use the following DNS server addresses -> Enter the Preferred DNS Server and Alternate DNS addresses you want to use. You can use one of the DNS options provided at the beginning of this article. For example, for Cloudflare, enter 1.1.1.1 and 1.0.0.1.
Finally, click Save and restart your computer.
With this guide, you can easily change DNS on your Windows/Linux servers. Once changed, note that it may take a short time to see the effects of this action. If you found this article helpful, please support us by sharing it with TotHost!