Dynamically I want to edit/update hosts(etc/hosts) file to add domain.
To edit hosts(etc/hosts) file require Admin privileged. Using Linux I can do this by this command
sudo gedit /etc/hosts
But I am trying to do this from using Programming Language.
How can i do it?