Knowledge Base


« Domain, IP & DNS questions

Tests with the hosts file

A good way to test a website for which the DNS has not yet been changed is to make use of the hosts file. This enables you to visit a website before the DNS is pointing to it.

Windows

edit the file C:\WINDOWS\system32 ¬
\drivers\etc\hosts

OSX / Linux

Edit the file /etc/hosts as the root user in a terminal window.
In OSX you can find the Terminal.app in Applications > Utilities > Terminal.

Now enter the following

(on one line):
10.0.0.1 domainname.nl ¬
www.domainname.nl
Where 10.0.0.1 is the IP address of the destination and domainname.nl is the domain name you want to test.
Now clear the browser cache and flush your local DNS cache.

Windows

Call up a command line via Start > Run > cmd and enter the command:
ipconfig /flushdns

Linux

Restart the nscd daemon by entering the following in a terminal window (on one line):
/etc/rc.d/init.d/nscd ¬
restart

OSX

Enter the following in a terminal window:
OSX prior to 10.5:
lookupd -flushcache
OSX 10.5 or later:
dscacheutil -flushcache

Finally...

Restart your browser and surf to the test domain.
To make sure you are now on the right server, you can change something on the website. Or use Firefox in combination with the add-on ShowIP, which shows the IP address of the current page in the bottom right corner of your status bar.

To once again connect to the old server, remove the line from your hosts file, empty your browser's cache, flush the local DNS cache and restart your browser.

VPS Bestellen
VPS Bestellen