Changing DNS servers is very easy and can be done in the blink of an eye.
Although it is not necessary to change the DNS, sometimes it can be interesting for several reasons. It’s quite easy, regardless of operating system. If we focus on GNU / Linux, it can be done graphically, but also through the terminal. Today we will see how it is done using GNU Nano. However, first I would like to list, as a brief review, the main advantages of using a different DNS:
- Possible speed improvements
- Possible reliability improvements
- Parental controls
- Protection against phishing
- Security elements
- Access content blocked by geolocation
- Make a by-pass to censorship
How to change DNS in Linux
- We open the terminal.
- We write: nano /etc/resolv.conf. With this we open the file resolv.conf with the terminal editor. In this file is the DNS configuration.
- We look for the lines that start with nameserver.
- We move 2 lines down the default DNS and in the lines that are free we write nameserver followed by a space and the address of the DNS server that we want to establish. In the next line we write the same, but in this case we will put the IP address of the secondary DNS. We have used the Google public servers, 8.8.8.8 as primary and 8.8.4.4 as secondary, in case the first one fails.
- We save by pressing Ctrl + O and then we press Enter to overwrite.
We can also put another DNS, the ones we want, from the internal DNS of our company to another alternative DNS. Always in another line, either below or above, depending on the preference we want to give it. The first will be the one with the most preference.
In this tutorial we have chosen Google servers because as a general rule they are usually faster and more reliable That the others.
As we have seen is extremely easy change our default DNS server and benefit from privileges that, although we do not perceive them at first glance, we will appreciate it in the long run.
Related topics: Linux
Subscribe to Disney + for only € 8.99!