<?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"><channel><title><![CDATA[Change DNS servers, wifi and mobile data]]></title><description><![CDATA[<p dir="auto">Looking on the forum I found how to change the DNS servers only for the wifi networks but I wanted to choose the servers also for mobile data ... I created a script to set up alternate DNS servers / restore original settings.</p>
<p dir="auto">This script makes a file immutable (chattr +i) and this may cause the OTA update to fail, so before the update OTA 23 I have restored the original settings.</p>
<ul>
<li>nano /home/phablet/your_path/setdns.sh<br />
and make it executable (chmod u+x)</li>
</ul>
<pre><code>#!/bin/bash

# Make sure only root can run this script
if [ "$(id -u)" != "0" ]; then
   echo "    Must be run as root, you must prepend sudo !" 1&gt;&amp;2
   exit 1
fi

echo -e '\n    - You can set up alternate DNS servers / restore original settings -\n' ;
#
# these are Cloudflare's DNS servers, you can change them with your preferred
dns_one=1.1.1.1
dns_two=1.0.0.1

PS3='Please enter your choice : '
options=("Set new DNS servers" "Roll back your system" "Quit")
select opt in "${options[@]}"
do
	case $opt in
	"Set new DNS servers")
		if grep -qs 'dns=dnsmasq' /etc/NetworkManager/NetworkManager.conf

		then
			echo -e '\n   Remember to "roll back" your system before the next OTA update !\n' ;

			# mount root in read/write mode
			mount -o remount,rw / ;

			# remove /etc/resolv.conf (is a symbolic link pointing to /run/resolvconf/resolv.conf)
			rm /etc/resolv.conf ;

			# create /etc/resolv.conf
			touch /etc/resolv.conf ;

			# add it your DNS servers
			echo -e "nameserver $dns_one\nnameserver $dns_two" &gt;&gt; /etc/resolv.conf ;

			# set permission
			chmod 644 /etc/resolv.conf ;

			# make it immutable
			chattr +i /etc/resolv.conf ;

			# replace dns=dnsmasq  with  dns=none in NetworkManager conf file
			sed -i 's/dns=dnsmasq/dns=none/' /etc/NetworkManager/NetworkManager.conf ;

			# remount root in read only mode
			mount -o remount,ro / ;

			echo -e '    Done, DNS servers are set up !\n'

			exit 0

		else

			echo -e '\n   Remember to "roll back" your system before the next OTA update !\n' ;

			# mount root in read/write mode
			mount -o remount,rw / ;

			# makes /etc/resolv.conf writable/erasable
			chattr -i /etc/resolv.conf ;

			# add it your DNS servers
			echo -e "nameserver $dns_one\nnameserver $dns_two" &gt; /etc/resolv.conf ;

			# make it immutable
			chattr +i /etc/resolv.conf ;

                       # remount root in read only mode
                        mount -o remount,ro / ;

			echo -e '    Done, DNS servers are set up !\n'

			exit 0

		fi

		;;
	"Roll back your system")
			# mount root in read/write mode
			mount -o remount,rw / ;

			# makes /etc/resolv.conf writable/erasable
			chattr -i /etc/resolv.conf ;

			# remove it
			rm /etc/resolv.conf ;

			# recreate  original simbolic link
			ln -s /run/resolvconf/resolv.conf /etc/resolv.conf ;

			# replace dns=none  with  dns=dnsmasq in NetworkManager conf file
			sed -i 's/dns=none/dns=dnsmasq/' /etc/NetworkManager/NetworkManager.conf ;

                       # remount root in read only mode
                        mount -o remount,ro / ;

			echo -e '\n   Done, DNS settings restored, reboot your device !\n'

			exit 0

		;;
        "Quit")
			break
		;;
			*) echo "invalid option $REPLY"
		;;
    esac
done
</code></pre>
<p dir="auto">this script sets the Cloudflare's DNS servers, before running it you can change them with your preferred.</p>
<ul>
<li>cd /home/phablet/your_path</li>
</ul>
<pre><code>sudo ./setdns.sh
</code></pre>
<ul>
<li>You can check the DNS server used <a href="https://www.top10vpn.com/tools/what-is-my-dns-server/" rel="nofollow ugc">here</a></li>
</ul>
]]></description><link>https://forums.ubports.com/topic/8013/change-dns-servers-wifi-and-mobile-data</link><generator>RSS for Node</generator><lastBuildDate>Tue, 14 Apr 2026 15:25:18 GMT</lastBuildDate><atom:link href="https://forums.ubports.com/topic/8013.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 07 Aug 2022 09:27:03 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Change DNS servers, wifi and mobile data on Fri, 21 Nov 2025 12:16:28 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/user/br1" aria-label="Profile: Br1">@<bdi>Br1</bdi></a> . Could you please update your very useful script for Noble ? I'm still using your last focal script which works yet with Noble, but with an error. Thanks in advance.<br />
<img src="/assets/uploads/files/1763727360633-screenshot20251019_195605222.png" alt="screenshot20251019_195605222.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forums.ubports.com/post/90539</link><guid isPermaLink="true">https://forums.ubports.com/post/90539</guid><dc:creator><![CDATA[domubpkm]]></dc:creator><pubDate>Fri, 21 Nov 2025 12:16:28 GMT</pubDate></item><item><title><![CDATA[Reply to Change DNS servers, wifi and mobile data on Sun, 11 Feb 2024 13:52:23 GMT]]></title><description><![CDATA[<p dir="auto">--- New version (only an optimization) <a href="https://spazio.v6.rocks/set-dns/setdns-ota.4.tar.gz" rel="nofollow ugc">here</a>, as reported by <a class="plugin-mentions-user plugin-mentions-a" href="/user/domubpkm" aria-label="Profile: domubpkm">@<bdi>domubpkm</bdi></a> to restore the original dns servers reboot is required (added message).</p>
]]></description><link>https://forums.ubports.com/post/78529</link><guid isPermaLink="true">https://forums.ubports.com/post/78529</guid><dc:creator><![CDATA[Br1]]></dc:creator><pubDate>Sun, 11 Feb 2024 13:52:23 GMT</pubDate></item><item><title><![CDATA[Reply to Change DNS servers, wifi and mobile data on Fri, 02 Feb 2024 00:46:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/br1" aria-label="Profile: Br1">@<bdi>Br1</bdi></a> said in <a href="/post/78302">Change DNS servers, wifi and mobile data</a>:</p>
<blockquote>
<p dir="auto">It could be caused by dns cache, after restoring try this :</p>
<p dir="auto">sudo resolvectl flush-caches</p>
</blockquote>
<p dir="auto">Sorry, i can't confirm it works for me. A reboot is yet  necessary.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/br1" aria-label="Profile: Br1">@<bdi>Br1</bdi></a> said in <a href="/post/78302">Change DNS servers, wifi and mobile data</a>:</p>
<blockquote>
<p dir="auto">Shouldn't cloudflare DNS all stay in its country of origin</p>
<p dir="auto">servers in 120+ countries ... I don’t know what criteria they use</p>
</blockquote>
<p dir="auto">When i did my precedent feedback, i was in RC TEST OTA-4. Now i am on 'real' OTA-4 and all cloudfare DNS are in my country. So for this, it's solved. <img src="https://forums.ubports.com/assets/plugins/nodebb-plugin-emoji/emoji/android/1f914.png?v=eeff4b5fc81" class="not-responsive emoji emoji-android emoji--thinking_face" style="height:23px;width:auto;vertical-align:middle" title="🤔" alt="🤔" /> <img src="https://forums.ubports.com/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=eeff4b5fc81" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:23px;width:auto;vertical-align:middle" title="🙂" alt="🙂" /></p>
]]></description><link>https://forums.ubports.com/post/78303</link><guid isPermaLink="true">https://forums.ubports.com/post/78303</guid><dc:creator><![CDATA[domubpkm]]></dc:creator><pubDate>Fri, 02 Feb 2024 00:46:12 GMT</pubDate></item><item><title><![CDATA[Reply to Change DNS servers, wifi and mobile data on Thu, 01 Feb 2024 23:20:52 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/domubpkm" aria-label="Profile: domubpkm">@<bdi>domubpkm</bdi></a> said in <a href="/post/78208">Change DNS servers, wifi and mobile data</a>:</p>
<blockquote>
<p dir="auto">Sometimes a reboot is necessary to get my carrier's DNS fully restored</p>
</blockquote>
<p dir="auto">It could be caused by dns cache, after restoring try this :</p>
<pre><code>sudo resolvectl flush-caches
</code></pre>
<p dir="auto">if it works, I can add it to next version</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/domubpkm" aria-label="Profile: domubpkm">@<bdi>domubpkm</bdi></a> said in <a href="/post/78208">Change DNS servers, wifi and mobile data</a>:</p>
<blockquote>
<p dir="auto">Shouldn't cloudflare DNS all stay in its country of origin</p>
</blockquote>
<p dir="auto">servers in 120+ countries ... I don’t know what criteria they use</p>
]]></description><link>https://forums.ubports.com/post/78302</link><guid isPermaLink="true">https://forums.ubports.com/post/78302</guid><dc:creator><![CDATA[Br1]]></dc:creator><pubDate>Thu, 01 Feb 2024 23:20:52 GMT</pubDate></item><item><title><![CDATA[Reply to Change DNS servers, wifi and mobile data on Thu, 25 Jan 2024 02:43:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/br1" aria-label="Profile: Br1">@<bdi>Br1</bdi></a></p>
<p dir="auto">New tests.</p>
<p dir="auto">I noted this:<br />
.  Sometimes a reboot is necessary to get my carrier's DNS fully restored if I no longer want to use cloudflare dns. Just using the 'restore' option in the script is not enough.</p>
<p dir="auto">. When using cloudflare, in the list of cloudflare DNS servers, some are in the USA (Missouri). Is this normal ? Shouldn't cloudflare DNS all stay in its country of origin like I see with Firefox (all in France for me) ?</p>
<p dir="auto">Thank you to enlighten me.</p>
]]></description><link>https://forums.ubports.com/post/78208</link><guid isPermaLink="true">https://forums.ubports.com/post/78208</guid><dc:creator><![CDATA[domubpkm]]></dc:creator><pubDate>Thu, 25 Jan 2024 02:43:36 GMT</pubDate></item><item><title><![CDATA[Reply to Change DNS servers, wifi and mobile data on Wed, 24 Jan 2024 02:52:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/br1" aria-label="Profile: Br1">@<bdi>Br1</bdi></a> I am on RC test OTA-4, it seems ok for me.</p>
]]></description><link>https://forums.ubports.com/post/78175</link><guid isPermaLink="true">https://forums.ubports.com/post/78175</guid><dc:creator><![CDATA[domubpkm]]></dc:creator><pubDate>Wed, 24 Jan 2024 02:52:36 GMT</pubDate></item><item><title><![CDATA[Reply to Change DNS servers, wifi and mobile data on Wed, 15 Nov 2023 22:35:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/br1" aria-label="Profile: Br1">@<bdi>Br1</bdi></a> Done, it works as expected.</p>
]]></description><link>https://forums.ubports.com/post/76794</link><guid isPermaLink="true">https://forums.ubports.com/post/76794</guid><dc:creator><![CDATA[domubpkm]]></dc:creator><pubDate>Wed, 15 Nov 2023 22:35:15 GMT</pubDate></item><item><title><![CDATA[Reply to Change DNS servers, wifi and mobile data on Wed, 15 Nov 2023 13:07:05 GMT]]></title><description><![CDATA[<p dir="auto">OTA 3 Stable channel --- You can reinstall, no changes are necessary.</p>
]]></description><link>https://forums.ubports.com/post/76763</link><guid isPermaLink="true">https://forums.ubports.com/post/76763</guid><dc:creator><![CDATA[Br1]]></dc:creator><pubDate>Wed, 15 Nov 2023 13:07:05 GMT</pubDate></item><item><title><![CDATA[Reply to Change DNS servers, wifi and mobile data on Wed, 15 Nov 2023 13:06:47 GMT]]></title><description><![CDATA[<p dir="auto"><s>I can’t test ota 3 update, install at your own risk <strong>(*)</strong></s></p>
]]></description><link>https://forums.ubports.com/post/76738</link><guid isPermaLink="true">https://forums.ubports.com/post/76738</guid><dc:creator><![CDATA[Br1]]></dc:creator><pubDate>Wed, 15 Nov 2023 13:06:47 GMT</pubDate></item><item><title><![CDATA[Reply to Change DNS servers, wifi and mobile data on Mon, 13 Nov 2023 20:46:05 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/br1" aria-label="Profile: Br1">@<bdi>Br1</bdi></a> Hello. is your OTA-2 work / procedure the same for OTA-3 ? Thanks again</p>
]]></description><link>https://forums.ubports.com/post/76722</link><guid isPermaLink="true">https://forums.ubports.com/post/76722</guid><dc:creator><![CDATA[domubpkm]]></dc:creator><pubDate>Mon, 13 Nov 2023 20:46:05 GMT</pubDate></item><item><title><![CDATA[Reply to Change DNS servers, wifi and mobile data on Tue, 10 Oct 2023 22:11:11 GMT]]></title><description><![CDATA[<p dir="auto">---- UPDATE OTA-2 Focal ----<br />
---- <strong>Stable Channel</strong>  ----</p>
<p dir="auto">Usual three steps :</p>
<p dir="auto">1 - download (just tap) setdns-ota.2 from <a href="https://spazio.v6.rocks/set-dns/setdns-ota.2.tar.gz" rel="nofollow ugc">here</a></p>
<p dir="auto">2 - open file manager, go to Downloads, tap setdns-ota.2.tar.gz and tap extract archive</p>
<p dir="auto">3 - open terminal, type :</p>
<pre><code>sudo Downloads/setdns-ota.2/setdns-ota.2.sh
</code></pre>
<p dir="auto">and hit enter,</p>
<p dir="auto">type 1 + enter to set Cloudflare servers<br />
type 2 + enter to set OpenDNS servers<br />
type 3 + enter to set custom servers  (*)<br />
type 4 + enter to restore default settings (Restore OS)<br />
type 5 + enter to exit (OS unchanged)</p>
<p dir="auto"><strong>Remember to "Restore OS" before the next OTA update !</strong></p>
<p dir="auto">set-dns is one single script, preview :</p>
<pre><code>#!/bin/bash

# Make sure only root can run this script
if [ "$(id -u)" != "0" ]; then
   echo " - You must prepend 'sudo' !" 1&gt;&amp;2
   exit 1
fi

echo -e '\n- Set DNS servers / Restore default -\n' ;

rsv_cnf=/etc/resolv.conf ;

# these are Cloudflare's DNS servers
CLF_one=1.1.1.1
CLF_two=1.0.0.1

# these are OpenDNS servers
OPE_one=208.67.222.222
OPE_two=208.67.220.220

PS3='
Please enter your choice : '
options=("  Cloudflare  -      " "  OpenDNS     -      " "  Custom DNS  -      " "  Restore OS  -      " "  Quit        -      ")
select opt in "${options[@]}"
do
	case $opt in
	"  Cloudflare  -      ")
		# check resolv.conf
		if [ ! -L $rsv_cnf ] ;

		then

			# -------------------- runs if resolv.conf is a file --------------------

			# mount root in read/write mode
			mount -o remount,rw / ;

			# add it Cloudflare servers
			echo -e "# Cloudflare servers" &gt; $rsv_cnf ; echo -e "nameserver $CLF_one" &gt;&gt; $rsv_cnf ; echo -e "nameserver $CLF_two" &gt;&gt; $rsv_cnf ;

			# remount root in read only mode
			mount -o remount,ro / ;

			echo -e '\n Cloudflare DNS are set up !\n'

			exit 0

		else

			# -------------------- runs if resolv.conf is a symbolic link --------------------

			# mount root in read/write mode
			mount -o remount,rw / ;

			# delete symbolic link
			rm /etc/resolv.conf ;

			# create file
			touch /etc/resolv.conf ;

			# add it Cloudflare servers
			echo -e "# Cloudflare servers" &gt; $rsv_cnf ; echo -e "nameserver $CLF_one" &gt;&gt; $rsv_cnf ; echo -e "nameserver $CLF_two" &gt;&gt; $rsv_cnf ;

                       # remount root in read only mode
                        mount -o remount,ro / ;

			echo -e '\n Cloudflare DNS are set up !\n'

			exit 0

		fi

		;;

	"  OpenDNS     -      ")
		# check resolv.conf
		if [ ! -L $rsv_cnf ] ;

		then

			# -------------------- runs if resolv.conf is a file --------------------

			# mount root in read/write mode
			mount -o remount,rw / ;

			# add it Cloudflare servers
			echo -e "# OpenDNS servers" &gt; $rsv_cnf ; echo -e "nameserver $OPE_one" &gt;&gt; $rsv_cnf ; echo -e "nameserver $OPE_two" &gt;&gt; $rsv_cnf ;

			# remount root in read only mode
			mount -o remount,ro / ;

			echo -e '\n OpenDNS servers are set up !\n'

			exit 0

		else

			# -------------------- runs if resolv.conf is a symbolic link --------------------

			# mount root in read/write mode
			mount -o remount,rw / ;

			# delete symbolic link
			rm /etc/resolv.conf ;

			# create file
			touch /etc/resolv.conf ;

			# add it Cloudflare servers
			echo -e "# OpenDNS servers" &gt; $rsv_cnf ; echo -e "nameserver $OPE_one" &gt;&gt; $rsv_cnf ; echo -e "nameserver $OPE_two" &gt;&gt; $rsv_cnf ;

                       # remount root in read only mode
                        mount -o remount,ro / ;

			echo -e '\n OpenDNS servers are set up !\n'

			exit 0

		fi

		;;

	"  Custom DNS  -      ")
		# check resolv.conf
		if [ ! -L $rsv_cnf ] ;

		then

			# -------------------- runs if resolv.conf is a file -------------------- 

			# mount root in read/write mode
			mount -o remount,rw / ;

			echo -e "# Custom DNS servers" &gt; $rsv_cnf ; 

                                        read -p " Type primary server : " priDN

					echo -e "nameserver $priDN" &gt;&gt; $rsv_cnf ;

					read -p " Type secondary server : " secDN

					echo -e "nameserver $secDN" &gt;&gt; $rsv_cnf ;

			# remount root in read only mode
			mount -o remount,ro / ;

			echo -e '\n Custom DNS are set up !\n'

			exit 0

		else

			# -------------------- runs if resolv.conf is a symbolic link --------------------

			# mount root in read/write mode
			mount -o remount,rw / ;

			# delete symbolic link
			rm /etc/resolv.conf ;

			# create file
			touch /etc/resolv.conf ;

			echo -e "# Custom DNS servers" &gt; $rsv_cnf ;

                                        read -p " Type primary server : " priDN

                                        echo -e "nameserver $priDN" &gt;&gt; $rsv_cnf ;

                                        read -p " Type secondary server : " secDN

                                        echo -e "nameserver $secDN" &gt;&gt; $rsv_cnf ;

                       # remount root in read only mode
                        mount -o remount,ro / ;

			echo -e '\n Custom DNS are set up !\n'

			exit 0

		fi

		;;

	"  Restore OS  -      ")
			# mount root in read/write mode
			mount -o remount,rw / ;

			# delete file
			rm /etc/resolv.conf ;

			# recreate symbolic link
			ln -s /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf ;

                       # remount root in read only mode
                        mount -o remount,ro / ;

			echo -e '\n Default settings have been Restored !\n'

			exit 0

		;;
        "  Quit        -      ")
			echo -e '\n  - OS unchanged !\n'

			break
		;;
			*) echo "invalid option $REPLY"
		;;
    esac
done

</code></pre>
<p dir="auto">(*) For example, if you want to set Google DNS servers enter 8.8.8.8 as primary server and 8.8.4.4 as secondary server.</p>
]]></description><link>https://forums.ubports.com/post/76017</link><guid isPermaLink="true">https://forums.ubports.com/post/76017</guid><dc:creator><![CDATA[Br1]]></dc:creator><pubDate>Tue, 10 Oct 2023 22:11:11 GMT</pubDate></item><item><title><![CDATA[Reply to Change DNS servers, wifi and mobile data on Sat, 22 Apr 2023 18:38:13 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/domubpkm" aria-label="Profile: domubpkm">@<bdi>domubpkm</bdi></a> said in <a href="/post/72509">Change DNS servers, wifi and mobile data</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/br1" aria-label="Profile: Br1">@<bdi>Br1</bdi></a> typo error</p>
</blockquote>
<p dir="auto">fixed, thank you.</p>
]]></description><link>https://forums.ubports.com/post/72516</link><guid isPermaLink="true">https://forums.ubports.com/post/72516</guid><dc:creator><![CDATA[Br1]]></dc:creator><pubDate>Sat, 22 Apr 2023 18:38:13 GMT</pubDate></item><item><title><![CDATA[Reply to Change DNS servers, wifi and mobile data on Sun, 09 Apr 2023 08:15:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/keneda" aria-label="Profile: Keneda">@<bdi>Keneda</bdi></a> to build apps it is necessary to know qml and python and I don't know them <img src="https://forums.ubports.com/assets/plugins/nodebb-plugin-emoji/emoji/android/1f61e.png?v=eeff4b5fc81" class="not-responsive emoji emoji-android emoji--disappointed" style="height:23px;width:auto;vertical-align:middle" title=":-(" alt="😞" /> "Touch IDE" is an interesting app, but I would like to do something with shell scripting</p>
]]></description><link>https://forums.ubports.com/post/72089</link><guid isPermaLink="true">https://forums.ubports.com/post/72089</guid><dc:creator><![CDATA[Br1]]></dc:creator><pubDate>Sun, 09 Apr 2023 08:15:36 GMT</pubDate></item><item><title><![CDATA[Reply to Change DNS servers, wifi and mobile data on Fri, 07 Apr 2023 22:15:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/br1" aria-label="Profile: Br1">@<bdi>Br1</bdi></a><br />
I don't know if you saw my post responding to you on another of your thread so i put link here, it may be helpfull : <a href="https://forums.ubports.com/topic/8144/how-to-record-calls/4?_=1680905394718">https://forums.ubports.com/topic/8144/how-to-record-calls/4?_=1680905394718</a></p>
]]></description><link>https://forums.ubports.com/post/72070</link><guid isPermaLink="true">https://forums.ubports.com/post/72070</guid><dc:creator><![CDATA[Keneda]]></dc:creator><pubDate>Fri, 07 Apr 2023 22:15:20 GMT</pubDate></item><item><title><![CDATA[Reply to Change DNS servers, wifi and mobile data on Fri, 07 Apr 2023 09:14:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/keneda" aria-label="Profile: Keneda">@<bdi>Keneda</bdi></a> I can't promise anything but I will try.</p>
]]></description><link>https://forums.ubports.com/post/72048</link><guid isPermaLink="true">https://forums.ubports.com/post/72048</guid><dc:creator><![CDATA[Br1]]></dc:creator><pubDate>Fri, 07 Apr 2023 09:14:39 GMT</pubDate></item><item><title><![CDATA[Reply to Change DNS servers, wifi and mobile data on Thu, 06 Apr 2023 23:03:02 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/br1" aria-label="Profile: Br1">@<bdi>Br1</bdi></a> As he said, Keneda if you can building an app, this would be great. I tried it on focal. It worked with me in the first time, and when I tried to return to restore default settings, I lost my connection to the Internet without finding a solution, despite my attempts to fix it, which forced me to re-install UT <img src="https://forums.ubports.com/assets/plugins/nodebb-plugin-emoji/emoji/android/1f605.png?v=eeff4b5fc81" class="not-responsive emoji emoji-android emoji--sweat_smile" style="height:23px;width:auto;vertical-align:middle" title="😅" alt="😅" /></p>
]]></description><link>https://forums.ubports.com/post/72043</link><guid isPermaLink="true">https://forums.ubports.com/post/72043</guid><dc:creator><![CDATA[kimo]]></dc:creator><pubDate>Thu, 06 Apr 2023 23:03:02 GMT</pubDate></item><item><title><![CDATA[Reply to Change DNS servers, wifi and mobile data on Thu, 06 Apr 2023 21:59:01 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/br1" aria-label="Profile: Br1">@<bdi>Br1</bdi></a><br />
Did you consider building an app for your 3 scripts to be nooby friendly ?</p>
]]></description><link>https://forums.ubports.com/post/72042</link><guid isPermaLink="true">https://forums.ubports.com/post/72042</guid><dc:creator><![CDATA[Keneda]]></dc:creator><pubDate>Thu, 06 Apr 2023 21:59:01 GMT</pubDate></item><item><title><![CDATA[Reply to Change DNS servers, wifi and mobile data on Thu, 06 Apr 2023 21:34:02 GMT]]></title><description><![CDATA[<p dir="auto">OTA-25 --- You can reinstall, it works.</p>
]]></description><link>https://forums.ubports.com/post/72040</link><guid isPermaLink="true">https://forums.ubports.com/post/72040</guid><dc:creator><![CDATA[Br1]]></dc:creator><pubDate>Thu, 06 Apr 2023 21:34:02 GMT</pubDate></item><item><title><![CDATA[Reply to Change DNS servers, wifi and mobile data on Sat, 22 Apr 2023 22:44:58 GMT]]></title><description><![CDATA[<p dir="auto">--------- UPDATE ---------<br />
New version to install/uninstall with single command, see <a href="https://forums.ubports.com/topic/8645/install-uninstall-scripts-with-single-command">here </a>for further information.</p>
<p dir="auto">You can set alternative dns servers and restore the default settings in an easy way, reboot not required.</p>
<p dir="auto">You can switch between two preset providers or enter the one you prefer.</p>
<p dir="auto"><strong>three steps :</strong></p>
<p dir="auto">1 - download (just click) set-dns.1.01.tar.gz <a href="https://spazio.v6.rocks/set-dns/set-dns.1.01.tar.gz" rel="nofollow ugc">from here</a></p>
<p dir="auto">2 - open file manager, go to Downloads, click set-dns.1.01.tar.gz and extract archive</p>
<p dir="auto">3 - open terminal and type :</p>
<pre><code>sudo Downloads/set-dns.1.01/setdns.sh
</code></pre>
<p dir="auto">You will see this :</p>
<p dir="auto"><img src="/assets/uploads/files/1677797201909-screenshot_0228_400.png" alt="screenshot_0228_400.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">type 1 to set Cloudflare servers<br />
type 2 to set OpenDNS  servers<br />
type 3 to set your preferred servers <strong>(*)</strong><br />
type 4 to restore default settings (Restore OS)<br />
type 5 to exit (OS unchanged)</p>
<p dir="auto"><strong>Remember to "Restore OS" before the next OTA update !</strong></p>
<p dir="auto">Preview :</p>
<pre><code>#!/bin/bash

# Make sure only root can run this script
if [ "$(id -u)" != "0" ]; then
   echo " - You must prepend 'sudo' !" 1&gt;&amp;2
   exit 1
fi

echo -e '\n- Set DNS servers / Restore default -\n' ;

# these are Cloudflare's DNS servers
CLF_one=1.1.1.1
CLF_two=1.0.0.1

# these are OpenDNS servers
OPE_one=208.67.222.222
OPE_two=208.67.220.220

PS3='
Please enter your choice : '
options=(" Cloudflare" " OpenDNS" " Custom DNS" " Restore OS" " Quit")
select opt in "${options[@]}"
do
	case $opt in
	" Cloudflare")
		# search the default string
		if grep -qs 'dns=dnsmasq' /etc/NetworkManager/NetworkManager.conf

		then

			# -------------------- runs if found default dns settings -------------------- 

			# mount root in read/write mode
			mount -o remount,rw / ;

			# remove /etc/resolv.conf (is a symbolic link pointing to /run/resolvconf/resolv.conf)
			rm /etc/resolv.conf ;

			# create /etc/resolv.conf
			touch /etc/resolv.conf ;

			# add it Cloudflare servers
			echo -e "nameserver $CLF_one\nnameserver $CLF_two" &gt;&gt; /etc/resolv.conf ;

			# set permission
			chmod 644 /etc/resolv.conf ;

			# make it immutable
			chattr +i /etc/resolv.conf ;

			# replace dns=dnsmasq  with  dns=none in NetworkManager conf file
			sed -i 's/dns=dnsmasq/dns=none/' /etc/NetworkManager/NetworkManager.conf ;

			# remount root in read only mode
			mount -o remount,ro / ;

			echo -e '\n Cloudflare DNS are set up !\n'

			exit 0

		else

			# -------------------- runs if dns settings are already changed --------------------

			# mount root in read/write mode
			mount -o remount,rw / ;

			# makes /etc/resolv.conf writable/erasable
			chattr -i /etc/resolv.conf ;

			# add it Cloudflare servers
			echo -e "nameserver $CLF_one\nnameserver $CLF_two" &gt; /etc/resolv.conf ;

			# make it immutable
			chattr +i /etc/resolv.conf ;

                       # remount root in read only mode
                        mount -o remount,ro / ;

			echo -e '\n Cloudflare DNS are set up !\n'

			exit 0

		fi

		;;

	" OpenDNS")
		# search the default string
		if grep -qs 'dns=dnsmasq' /etc/NetworkManager/NetworkManager.conf

		then

			# -------------------- runs if found default dns settings -------------------- 

			# mount root in read/write mode
			mount -o remount,rw / ;

			# remove /etc/resolv.conf (is a symbolic link pointing to /run/resolvconf/resolv.conf)
			rm /etc/resolv.conf ;

			# create /etc/resolv.conf
			touch /etc/resolv.conf ;

			# add it OpenDNS servers
			echo -e "nameserver $OPE_one\nnameserver $OPE_two" &gt;&gt; /etc/resolv.conf ;

			# set permission
			chmod 644 /etc/resolv.conf ;

			# make it immutable
			chattr +i /etc/resolv.conf ;

			# replace dns=dnsmasq  with  dns=none in NetworkManager conf file
			sed -i 's/dns=dnsmasq/dns=none/' /etc/NetworkManager/NetworkManager.conf ;

			# remount root in read only mode
			mount -o remount,ro / ;

			echo -e '\n OpenDNS Servers are set up !\n'

			exit 0

		else

			# -------------------- runs if dns settings are already changed --------------------

			# mount root in read/write mode
			mount -o remount,rw / ;

			# makes /etc/resolv.conf writable/erasable
			chattr -i /etc/resolv.conf ;

			# add it OpenDNS servers
			echo -e "nameserver $OPE_one\nnameserver $OPE_two" &gt; /etc/resolv.conf ;

			# make it immutable
			chattr +i /etc/resolv.conf ;

                       # remount root in read only mode
                        mount -o remount,ro / ;

			echo -e '\n OpenDNS Servers are set up !\n'

			exit 0

		fi

		;;

	" Custom DNS")
		# search the default string
		if grep -qs 'dns=dnsmasq' /etc/NetworkManager/NetworkManager.conf

		then

			# -------------------- runs if found default dns settings -------------------- 

			# mount root in read/write mode
			mount -o remount,rw / ;

			# remove /etc/resolv.conf (is a symbolic link pointing to /run/resolvconf/resolv.conf)
			rm /etc/resolv.conf ;

			# create /etc/resolv.conf
			touch /etc/resolv.conf ;

                                        read -p " Type primary server : " priDN

					echo -e "nameserver $priDN" &gt; /etc/resolv.conf ;

					read -p " Type secondary server : " secDN

					echo -e "nameserver $secDN" &gt;&gt; /etc/resolv.conf ;

			# set permission
			chmod 644 /etc/resolv.conf ;

			# make it immutable
			chattr +i /etc/resolv.conf ;

			# replace dns=dnsmasq  with  dns=none in NetworkManager conf file
			sed -i 's/dns=dnsmasq/dns=none/' /etc/NetworkManager/NetworkManager.conf ;

			# remount root in read only mode
			mount -o remount,ro / ;

			echo -e '\n Custom DNS are set up !\n'

			exit 0

		else

			# -------------------- runs if dns settings are already changed --------------------

			# mount root in read/write mode
			mount -o remount,rw / ;

			# makes /etc/resolv.conf writable/erasable
			chattr -i /etc/resolv.conf ;

                                        read -p " Type primary server : " priDN

                                        echo -e "nameserver $priDN" &gt; /etc/resolv.conf ;

                                        read -p " Type secondary server : " secDN

                                        echo -e "nameserver $secDN" &gt;&gt; /etc/resolv.conf ;


			# make it immutable
			chattr +i /etc/resolv.conf ;

                       # remount root in read only mode
                        mount -o remount,ro / ;

			echo -e '\n Custom DNS are set up !\n'

			exit 0

		fi

		;;

	" Restore OS")
			# mount root in read/write mode
			mount -o remount,rw / ;

			# makes /etc/resolv.conf writable/erasable
			chattr -i /etc/resolv.conf ;

			# remove it
			rm /etc/resolv.conf ;

			# recreate  original simbolic link
			ln -s /run/resolvconf/resolv.conf /etc/resolv.conf ;

			# replace dns=none  with  dns=dnsmasq in NetworkManager conf file
			sed -i 's/dns=none/dns=dnsmasq/' /etc/NetworkManager/NetworkManager.conf ;

                       # remount root in read only mode
                        mount -o remount,ro / ;

                       # restart daemon
                        service network-manager restart ;

			echo -e '\n Default settings have been restored !\n'

			exit 0

		;;
        " Quit")
			echo -e '\n OS unchanged !\n'

			break
		;;
			*) echo "invalid option $REPLY"
		;;
    esac
done
</code></pre>
<p dir="auto"><strong>(*)</strong> For example, if you want to set Google DNS servers enter 8.8.8.8 as primary server and 8.8.4.4 as secondary server.</p>
]]></description><link>https://forums.ubports.com/post/71078</link><guid isPermaLink="true">https://forums.ubports.com/post/71078</guid><dc:creator><![CDATA[Br1]]></dc:creator><pubDate>Sat, 22 Apr 2023 22:44:58 GMT</pubDate></item></channel></rss>