I'm trying to restore my iphone 4 but error 21 comes up, how can i fix this?

I've searched it up and most articles tell me to go edit my hosts file, but when I go the "system32" file and the whatever comes after I forgot, there's no "hosts" file just an "imhosts" file but its not the same thing, help.

Btw. The problem all started cause my iPhone 4 randomly died and won't turn on the Apple logo just came up when I connected it to the computer, so now I'm trying to restore it and this error 21 keeps coming up, I've tried it with other computers and same thing.

Take it into the apple store and ask the 'genius bar'
Hope this helps

Itunes Error 21 is the most common error users face while performing the restore on the iPhone. Device Firmware Upgrade mode known as DFU mode, this mode allows you to restore your iDevice with an original iOS version or a custom iOS version.

To resolve the iTunes Error 21 in order to restore your iPhone/iPod touch, connect to your device into DFU mode first to get by following the instructions according to your device, The steps below will help getting into DFU mode in case you do not know how to:
•Connect your device to your PC or Mac via a USB cable and launch iTunes.
•Hold Home + Power button for 10 seconds.
•After 10 seconds release the power button off, but keep the Home button pressed until iTunes a little device in recovery mode you find there.
•Once your device into DFU mode, you see nothing on the screen, only a black image. (See above)

If you successfully performed these steps, iTunes will give you a message that a device was found in Recovery Mode and restore it. Now you SHIFT + Restore in iTunes button to press together, so that iTunes can refer to the iOS firmware to which you are restoring to. If you have followed these steps you should be able to get rid of the iTunes Error 21 while restoring your iPhone. Now you have fixed iTunes error 21, and your iPhone can be restored to an ipsw custom firmware.

Go To This Site For More Help: http://www.ihelplounge.com/how-to-fix-itunes-error-21-while-restoring-the-iphone-ipod-touch/

When the apple logo is up do this video tutorial:

Once you restore it using this method, it should work.