<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by blackvoidx on Medium]]></title>
        <description><![CDATA[Stories by blackvoidx on Medium]]></description>
        <link>https://medium.com/@blackvoidx?source=rss-3e56b5081693------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*F1dcoTATgCgZNCFllJ6QvQ.png</url>
            <title>Stories by blackvoidx on Medium</title>
            <link>https://medium.com/@blackvoidx?source=rss-3e56b5081693------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 10:51:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@blackvoidx/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to Set DNS in Linux]]></title>
            <link>https://blackvoidx.medium.com/how-to-set-dns-in-linux-fcfc9300e03f?source=rss-3e56b5081693------2</link>
            <guid isPermaLink="false">https://medium.com/p/fcfc9300e03f</guid>
            <category><![CDATA[dns]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[dns-servers]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[blackvoidx]]></dc:creator>
            <pubDate>Thu, 03 Oct 2024 07:19:18 GMT</pubDate>
            <atom:updated>2024-10-03T07:20:47.237Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UXBgbRqg22CQDFbUq28evA.png" /></figure><p>Managing DNS (Domain Name System) settings is a crucial part of networking on any operating system, including Linux. Whether you’re troubleshooting connectivity issues, boosting privacy, or optimizing for speed, knowing how to manually configure DNS servers is an essential skill.</p><p>In this article, I’ll walk you through the steps to set DNS in Linux manually. After that, I’ll introduce a tool I’ve developed called <a href="https://github.com/mamad-1999/dns-changer"><strong>dns-changer</strong></a>, which simplifies the process and allows you to quickly switch between DNS servers with just a few commands.</p><p>When you edit the /etc/resolv.conf file to change your DNS, you might notice that your changes are sometimes overwritten. This usually happens because <strong>NetworkManager</strong> manages your network settings and automatically updates the DNS, undoing any manual changes you’ve made.</p><h4>Preventing NetworkManager from Overwriting DNS Settings</h4><p>To prevent this, we need to disable NetworkManager’s DNS management. You can do this in two ways:</p><h4>Option 1: Modify NetworkManager Settings</h4><ol><li>Open the NetworkManager configuration file:</li></ol><pre>sudo nano /etc/NetworkManager/NetworkManager.conf</pre><p>2. Under the <strong>[main]</strong> section, set <strong>dns=none</strong> to stop NetworkManager from controlling DNS:</p><pre>[main]<br>dns=none</pre><p>If you’re using <strong>systemd-resolved </strong>, you may also need to disable it or configure it to use your preferred DNS servers.</p><p>3. After making changes, restart the NetworkManager service:</p><pre>sudo systemctl restart NetworkManager</pre><p>Or, if you’re using <strong>systemd-resolved</strong>, restart it with:</p><pre>sudo systemctl restart systemd-resolved</pre><h4>Option 2: Unlink resolv.conf (Recommended)</h4><p>A simpler way to prevent overwriting is to unlink <strong>/etc/resolv.conf</strong>:</p><ol><li>Run this command to unlink the file:</li></ol><pre>sudo unlink /etc/resolv.conf</pre><p>2. Now, you can edit <strong>/etc/resolv.conf</strong> without NetworkManager overwriting your changes. Here’s an example of how to manually edit the file:</p><pre>sudo nano /etc/resolv.conf</pre><p>Add your DNS servers, for example:</p><pre>nameserver 8.8.8.8<br>nameserver 8.8.4.4</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*T45M-cGbLuahc1ARTguhsw.png" /><figcaption>Add google DNS in /etc/resolve.conf with vim</figcaption></figure><p>With these steps, your DNS configuration will remain intact.</p><p>Or, you can use my <a href="https://github.com/mamad-1999/dns-changer"><strong>dns-changer</strong></a> tool, written in Golang, to set various DNS servers with ease. Instead of manually editing the DNS settings, <strong>dns-changer</strong> automates the process.</p><p>You can also add custom DNS servers by simply updating the config.json file, which the tool uses to manage different DNS options. This allows you to switch between DNS servers quickly and customize the configuration to suit your needs.</p><p><a href="https://github.com/mamad-1999/dns-changer">GitHub - mamad-1999/dns-changer: A Go script to select and apply a DNS server in Linux.</a></p><p>Thank you for taking the time to read this guide! I hope it helps you manage your DNS settings more efficiently. Feel free to check out <strong>dns-changer</strong> and let me know if you have any feedback or suggestions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fcfc9300e03f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>