For this method, you need to jailbreak your iPhone/iPad. Once jailbroken => launch Cydia => search for iFile and install it.
Once install, start iFile.
When you first start iFile, you are placed in the /var/mobile directory. The hosts file is located in /etc/hosts so in order to edit it, you need to navigate to the /etc directory.
To do that, you click on “var” under your phone’s signal bar => next click on “/”
Now scroll up, find “etc” and click on it.
Find the file “hosts” and click on it => then click on Text Viewer.
Now click on “Edit” (below your signal bar) and start editing.