Home > Support > HOWTO List > Bypassing DNS server lookups by using /etc/hosts

Bypassing DNS server lookups by using /etc/hosts

By setting up host entries in /etc/hosts, you can bypass doing DNS lookups for that host.

This is especially helpful for testing your site before DNS changes are made (or have been seen by your local PC).

On Linux/Unix systems, this file is /etc/hosts. On Windows XP it is located in c:\windows\system32\drivers\etc\hosts.

Example /etc/hosts file: localhost.localdomain localhost localpc mydomain.com

In this example, browsing to http://mydomain.com would take you to regardless of any existing DNS records for 'mydomain.com'.