How can I test my website before my domain name has moved? (Editing the Hosts File)

You can already view your website on our server, even before your domain name has moved. You do this by adding the domain name together with the IP address of the server your account is on to your hosts file.


Editing on Windows: Open the Notepad program to edit your hosts file. Are you using Windows Vista, 7, 8/8.1, 10 or 11? Then you need to open Notepad as administrator (right-click the program and select 'Run as administrator').

In Notepad, go to 'C:\Windows\System32\drivers\etc'. Don't see any files here? Then change 'Text Documents (.txt)' in the bottom right to 'All Files (.*)'. Then open the file 'hosts'.

At the bottom of the file, add the following line on a new line: <IP address> <domain.ext> <www.domain.ext>

For example: 94.124.122.17 domainname.nl 94.124.122.17 www.domainname.nl

Save the change. From that moment on, the domain will point to the configured IP address, but only on your own system.


Editing on Mac: On a Mac, you edit the hosts file via Terminal. You can find it under 'Applications → Utilities → Terminal'. Once you have opened Terminal, use one of the following two commands to open and edit the file: sudo nano /private/etc/hosts sudo vi /private/etc/hosts

At the bottom of the opened file, add a line with the details of your domain name and the correct IP address. For example, it should look like this:

94.124.122.17 domainname.nl 94.124.122.17 www.domainname.nl

Save the file once you have added the line. Then run the following command: dscacheutil -flushcache

Do you want to undo the change later? Then put a '#' in front of the added line and run the command 'dscacheutil -flushcache' again.

Don't forget to remove these lines again once your domain has actually moved.

Related articles