This article outlines a procedure to change the DNS servers for all interfaces (wifi, cellular, etc.) on a Firefox OS device.
Preparing your environment
- On your phone, go to Developer settings and enable the following settings:
- Remote Debugging (in Firefox OS 1.4 and above, select ADB and Devtools from the drop down menu.)
- Console Enabled
- Make sure that you have got ADB/Fastboot installed on your computer.
- Once these steps are done, plug your phone into your computer via USB.
Steps to update DNS
- Open a terminal window.
- Pull the DNS configuration file onto your computer with the below command:
adb pull /system/etc/dhcpcd/dhcpcd-hooks/20-dns.conf 20-dns.conf
- Find lines 22 to 26 of the file:
count=1 for dnsaddr in ${new_domain_name_servers}; do setprop dhcp.${intf}.dns${count} ${dnsaddr} count=$(($count + 1)) done
- Inside this section, replace the
setprop
line with lines like the following (you can include up to 4 DNS servers):setprop dhcp.${intf}.dns1 <DNS server 1 ip adress> setprop dhcp.${intf}.dns2 <DNS server 2 ip adress> setprop dhcp.${intf}.dns3 <DNS server 3 ip adress> setprop dhcp.${intf}.dns4 <DNS server 4 ip adress>
- Remount the
/system
partition on the device to get read-write permissions, like so:adb remount
- Backup the original file, just in case:
adb shell mv /system/etc/dhcpcd/dhcpcd-hooks/20-dns.conf /system/etc/dhcpcd/dhcpcd-hooks/20-dns.bak.conf
- Push the edited file and apply the correct permissions to it, as follows:
adb push 20-dns.conf /system/etc/dhcpcd/dhcpcd-hooks/20-dns.conf adb shell chmod 644 /system/etc/dhcpcd/dhcpcd-hooks/20-dns.conf
- Reboot the device and your DNS server settings will be updated.