Hosts File FAQ

About hosts files

A hosts file can be used to override the DNS for your domain name. This is ideal for testing new site hosting before making any public DNS changes, so that you can confirm everything is working right.

To point myexample.com.au domain to 202.174.108.4 using your hosts file we will simply need to add the following lines into the hosts file:

202.174.108.4   myexample.com.au
202.174.108.4   www.myexample.com.au
Advanced IPv6 tips:

Manually Set an IPv6 AAAA record:

2402:e400::0     myexample.com.au
2402:e400::0     www.myexample.com.au

Override existing IPv6 AAAA records with an IPv4 address:

::ffff:202.174.108.4   myexample.com.au
::ffff:202.174.108.4   www.myexample.com.au

How-To

For modern Windows users open the start menu and type notepad to have the built-in search locate the Notepad Desktop App. Then right-click on it and select Run as administrator:

Run Notepa as Administrator


Within Notepad click File > Open... and type or copy-paste the following File name:

C:\Windows\system32\drivers\etc\hosts

Notepad > Open > c:\windows\system32\drivers\etc\hosts


Once you have clicked Open you will see the contents of your hosts file. This is where we add the IP address followed by the domain name on a new line, in our example we will add the following:

202.174.108.4   myexample.com.au
202.174.108.4   www.myexample.com.au

Notepad > Open > c:\windows\system32\drivers\etc\hosts


Remember to Save the changes in notepad before we ping to test the changes made:

ping www.myexample.com.au

cmd.exe > ping www.myexample.com.au


Cleaning Up

As long as these lines remain in the hosts file the DNS override will be in effect for your PC, so always be sure to remove any additions made to your hosts file when you have finished your testing.


Further Resources

Still in need of help? For speedy assistance our friendly staff are always ready to help via our helpdesk, on Twitter, through our website, or directly via email to support.