This post was most recently updated on March 9th, 2026
How to add entry into hosts file in ubuntu (via terminal)
- Open terminal and run sudo nano /etc/hosts to open the hosts file.
- Add your IP and hostname entry. example: 0.0.0.0 hostname
- press CTRL + O to save
- press CTRL + X to exit
