With the help of following post I was able to edit the etc/hosts file inside the Android emulator.
The issue I am facing is that the moment I close the session after editing the host file and opening the emulator again with "emulator -avd " command (without -writable-system) the changes to host file are not reflected (which I did in the last session). They got reverted back to default.
Is this a known issue?
How can I preseve the changes to host file which I modified via adb push command to /system/etc/hosts files (during emulator -avd -writable-system operation)?
I have already gone through these but got no solution:
https://android.stackexchange.com/questions/20213/hosts-file-keeps-reverting Changes in Hosts file lost when not using -writable-system in Android Emulator