In Networking Last updated:
Share on:
Cloudways offers managed cloud hosting for any size business to host a website or complex web applications.

Changing your computer’s DNS system settings allows you to utilize something more secure and reliable than what your ISP provides.

Built-in DNS, which are your ISP’s domain name servers, could be slower, unstable, and not very private. To optimize your online experience, you can always use various resolvers from third-party providers.

This article will look at how to change the DNS settings for faster browsing in both Windows and Linux.

What is DNS?

Domain Name System (DNS) servers resolve domain names and determine the website’s IP address. This allows you to quickly access any website with a distinctive name. It’s simply a phone book for the internet, like saving the contacts using the name for mobile numbers.


Surfing the internet would be tough without them.

Your internet connection becomes unstable if your DNS slows down or becomes unreliable. In such instances, you may choose to connect to the internet on your computer using an alternative, safe, and dependable DNS.

It may be simpler to modify DNS settings on your Wi-Fi network so that it can be used by all devices connected to it.  However, you may want to update the DNS settings on individual devices, particularly on your computer.

You can easily update the DNS settings in Windows and Android in a few different ways.

DNS Server settings

OpenDNS,  Cloudflare, Comodo Secure DNS, and Google Public DNS are some of the best and free public DNS servers available.

Cloudflare DNS: and

Google DNS: and

Comodo Secure: and

Open DNS208.67.222.222 and

There are other reasons why people wish to change DNS, in addition to improved security and reliability, like using parental control and web filtering business features.

Changing DNS in Linux

Configuring the DNS servers in Linux is very easy. You need to add the nameservers to the configuration file.

In most Linux-based operating systems, /etc/resolv.conf file specifies the DNS servers which the system utilities use for name resolution. There should be at least one nameserver line in the file. A DNS server is defined by each nameserver line. The priority of the nameservers is determined by the order in which the system locates them in the file.

Just follow the below steps to change your Linux server’s DNS settings.

Step 1: Open the terminal and run the following commands one by one in the root user mode.

rm -r /etc/resolv.conf
nano /etc/resolv.conf

Step 2: Type the following lines into the text editor after it has opened.


The addresses listed above are Google DNS server addresses. Here you can use any DNS server address. Make sure you add the correct address.

Step 3: The following step is to save and close the document. To save and close the file, hit Ctrl + X, then Y. Continue to type in the terminal now.

Step 4: Type the following command in the terminal to make resolv.conf immutable to modifications.

sudo chattr +i /etc/resolv.conf

Step 5: After the files have been saved, you can make the changes by rebooting or running the below command.

sudo /etc/init.d/networking restart

That’s it! You are now using the new DNS servers which you have added.

Changing DNS in Windows

We can change the DNS settings in windows manually or by using some tools, which are free and reliable.

Using Control panel

Step 1: Open the Control Panel.

Step 2: Select Network and Internet from the drop-down menu.

Step 3: Select Network and Sharing Center

network and sharing

Step 4: In the left panel, select the Change adapter settings option

network adapter

Step 5: Select Properties from the right-click menu of the network interface.

Step 6: Choose the Internet Protocol Version 4 (TCP/IPv4) option.

Step 7: Click on the Properties button.


Step 8: Enter your “preferred,” and “alternative” DNS addresses in the boxes provided. Once you’ve completed the procedure, the device will begin using the DNS settings you selected right away.

Changing DNS in Windows using command prompt

Alternatively, you can modify the DNS settings on Windows using Command Prompt.  Follow these procedures to alter the device’s DNS settings using Command Prompt.

Step 1: Open the command prompt and run as an administrator.

Step 2: To open the utility to alter the networking settings, type the following command and click Enter.


Step 3: Use the following command and hit Enter to see the names of the network adapters.

interface show interface

Step 4: To set the primary DNS IP address, type the following command and press Enter.

interface ip set dns name="ADAPTER-NAME" source="static" address="X.X.X.X"

Remember to modify ADAPTER-NAME for the name of the network interface adapter you selected in Step 4 and XXXX for the IP address of the DNS server you want to use.

For example:

interface ip set dns name="Wi-Fi 2" source="static" address=""

Step 5: Add the preferred  DNS server address. To add an alternate DNS IP address, use the following command.

interface ip add dns name="ADAPTER-NAME" addr="X.X.X.X" index=2

Once you’ve completed the procedure, Windows will begin resolving domain names to numeric addresses using the new DNS server addresses.

Changing DNS in MAC

You can modify DNS settings in mac OS very easily.

Step 1: Select “System Preferences” from the Apple menu.

Step 2: Select the “Network” control panel from the drop-down menu.

Step 3: Choose your network interface from the list on the left (“Wi-Fi” or “Ethernet,” for example), and then click Next.

Step 4: In the Network window’s lower right corner, click the “Advanced” button.

Step 5: To change, add, or remove DNS records, go to the “DNS” tab at the top of the screen.


Step 6: After you’ve completed making DNS adjustments, click the “OK” button. To make the DNS changes take effect, click “Apply” and then exit System Preferences as usual.

The topmost DNS servers will be consulted first, so place the best-performing servers near the top of the list for optimal outcomes.

Wrapping Up 👨‍💻

When it comes to altering your DNS settings, there is no optimal or best option. Each public DNS has its own advantage for privacy and performance. Cloudflare and Google DNS are used by millions so you may want to try that to see if that works for you.

Feel free to learn about the best DNS monitoring tools for performance and configuration changes.
Also, learn how to check and clear the ARP cache or how to detect Rootkits in Windows, Linux and Mac.

Share on:
  • Ashlin Jenifa
    Hey there, my name is Ashlin, and I’m a senior technical writer. I’ve been in the game for a while now, and I specialize in writing about all sorts of cool technology topics like Linux, Networking, Security, Dev Tools, Data Analytics, and Cloud…

Thanks to our Sponsors

More great readings on Networking

Power Your Business

Some of the tools and services to help your business grow.
  • The text-to-speech tool that uses AI to generate realistic human-like voices.

    Try Murf AI
  • Web scraping, residential proxy, proxy manager, web unlocker, search engine crawler, and all you need to collect web data.

    Try Brightdata
  • is an all-in-one work OS to help you manage projects, tasks, work, sales, CRM, operations, workflows, and more.

    Try Monday
  • Intruder is an online vulnerability scanner that finds cyber security weaknesses in your infrastructure, to avoid costly data breaches.

    Try Intruder