hostsed is a simple python tool for editing hosts file (/etc/hosts), you can add or delete a DNS entry via command line shell (e.x. bash).
Links:
Workaround:
- Install locally with sudo and pip: sudo pip3 install hostsed
- Use as per documentation: sudo hostsed add <ip address> <hostname1>