What is a hosts file?
A hosts file is a small text file on your computer. It is like your own private address book. It tells your computer which IP address to use for a website name. An IP address is a number that identifies a computer on the internet.
Normally your computer asks DNS for this. DNS is the internet's phone book. The hosts file is checked first. This means you can test a new website on a new server before you change the real DNS. Only your computer is affected. Nobody else sees the change.
What you need
You need the server IP address. It is in your welcome email. You can also ask Hostvento support.
Warning: Editing the hosts file wrongly can stop sites from loading on your computer. Make a copy of the file first.
Steps on Windows
- Click the Start menu and type Notepad.
- Right-click Notepad and choose Run as administrator.
- Click File, then Open.
- Go to
C:\Windows\System32\drivers\etc. - Change the file type box to All Files.
- Open the file named
hosts. - At the bottom, add a new line.
Use your real server IP and your domain. The example IP here is only a sample.203.0.113.10 example.com www.example.com - Save the file.
Steps on Mac or Linux
- Open the Terminal app.
- Type the command below and press Enter.
This opens the hosts file in a text editor with admin rights.sudo nano /etc/hosts - Type your password if asked.
- Add the same kind of line at the bottom.
- Press Ctrl+O to save, Enter to confirm, then Ctrl+X to exit.
Test and clean up
- Close your browser fully and open it again.
- Visit your domain. You should see the site on the new server.
- When you finish testing, remove the line from the file. Save again.
Tip: A line starting with
# is a comment. The computer ignores it. Add one to turn a line off.Quick recap
- The hosts file maps a name to an IP on your computer only.
- Add a line with the server IP and the domain.
- Edit it as administrator and save.
- Remove the line when you finish testing.