Skip to content

Instantly share code, notes, and snippets.

@serianox
Last active August 28, 2022 00:48
Show Gist options
  • Save serianox/499d122e53e47c1eaad5 to your computer and use it in GitHub Desktop.
Save serianox/499d122e53e47c1eaad5 to your computer and use it in GitHub Desktop.
Very basic script for Android to set Google public DNS instead of mobile operator DNS
#!/bin/sh
# create a small script /sdcard/change-dns.sh that configures Google public DNS (requires to be run as root)
adb shell "echo \"#\0041/system/xbin/bash\" > /sdcard/change-dns.sh"
adb shell "echo \"su\" >> /sdcard/change-dns.sh"
adb shell "echo \"setprop net.dns1 8.8.8.8\" >> /sdcard/change-dns.sh"
adb shell "echo \"setprop net.dns2 8.8.4.4\" >> /sdcard/change-dns.sh"
adb shell "echo \"setprop net.rmnet0.dns1 8.8.8.8\" >> /sdcard/change-dns.sh"
adb shell "echo \"setprop net.rmnet0.dns2 8.8.4.4\" >> /sdcard/change-dns.sh"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment