I have nearly the same problem as Set Open DNS in Android 5.0.1 and the answer helped me.

Although I just want to change the DNS for blocking porn, what values for the following fields should I enter?

  • IP Address
  • Gateway
  • Network Prefix Length

I have HTC mobile with 5.1 Android version.


2 Answers 2


You should use OpenDNS Family shield which blocks porn and malicious websites.


If your ISP blocks other DNS's, try a secure connection (use Port 443):


If you're phone has root access I recommend using a paid app called OverrideDNS which encrypts your DNS queries like DNSCrypt and makes you forget about all DNS issues that you might have, it also works on cellular data.


To answer this, we need to understand some basics of networking and particularly how Internet Protocol works. This is a brief description of each field:

IP Address:

This is the base of modern day networking. Every device recognizes other device (on same network or on other network) by its address, called IP Address. Usually IP addresses are assigned by DHCP server running on a network e.g. the one that runs on a Wi-Fi router. DHCP server assigns a unique IP from the available pool to each device that connects.
So you need to get this value from your router. When configuring IP statically, you may use the same IP that was already assigned to your device when connected as DHCP client. However you should also configure router to assign that specific IP only to your device again when the lease is expired.


Gateways are special IP addresses that serve as the entry and exit points when the router directs traffic from one network to the other. On one side of Wi-Fi router is the local/private network to which all of your mobile phones and PC's are connected. While on the other side there is internet; the public network. So your router has two gateways; the public IP assigned to your router by ISP and the second one is usually the first IP of private network. So if is the network address of you local network and - say - is the IP address assigned to your phone, should be the gateway.

Network Prefix Length:

This basically defines the maximum number of IP addresses (hosts) a network can have. A 24-bit netmask ( length means the network can have maximum 254 hosts (232 - 24 - 2). First ( is the network address and last ( is the broadcast address. Remaining ( to can be assigned to hosts, including gateway.

Following is the DHCP settings of the Wi-Fi router my phone is connected to.

Further Reading:

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .