Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to setup an Apache virtual host without a domain name, I just want to use my IP to test my website until I get a domain name.

Examples in Apache documenation only seem to have domain name aliases like so

<VirtualHost *:80>
ServerName www.otherdomain.tld
DocumentRoot /www/otherdomain
share|improve this question
up vote 6 down vote accepted

Please note that the standard name-based virtual hosts depend on receiving a correct domain name from your browser request to serve the appropriate site (vhost).

The right way to test out multiple vhosts on your local machine is to give them any domain name you can think of, and simply map that domain to (localhost) by adding it to /etc/hosts.

For example:

<VirtualHost *:80>
    DocumentRoot /var/www/iamnotawizard

will work great as long as you add this line to /etc/hosts:
  • Note that Apache will throw a Could not reliably determine server's FQDN warning whenever started/restarted; you can safely ignore it.
share|improve this answer
apachectl -S might be a handy tool. More at… – michalzuber Jan 21 at 15:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.