Home > Miscellaneous > Adding hosts file entries in Linux

Adding hosts file entries in Linux

This post was most recently updated on March 9th, 2026

How to add entry into hosts file in ubuntu (via terminal)

  1. Open terminal and run sudo nano /etc/hosts  to open the hosts file.
  2. Add your IP and hostname entry. example: 0.0.0.0  hostname
  3. press CTRL + O to save
  4. press CTRL + X to exit
This Article is TAGGED in , , , , , , , . BOOKMARK THE permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">