Modifying the hosts file directly like that won't work. It has to be done via an app like AdAway which parses the source hosts file entries into a readable format for the Android OS. But it sounds like whatever app you're trying to use to rename the file doesn't have the proper root access. If it's ES File Explorer, you have to go into its root settings menu and ensure things like "Root Explorer" and "Mount File System as writable" are enabled.
Also check your Super user or SuperSU app to see if AdAway or any other apps are listed as having been granted root access. If you don't have a Super user or SuperSU app or nothing is listed in them, you may not be properly rooted. Try a root checker app from the Playstore to verify.