Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have to create a virtual host on a server which, previously hosted a single website (domain name). Now I'm trying to add a second domain on this server (using the same nameserver). What I've done so far:

Initially there was no virtual host so I've made one for the second domain:

NameVirtualHost *:80
<VirtualHost *:80>
        DocumentRoot /var/www/bla
        ServerName www.blabla.com
        ServerAlias blabla.com
    <Directory /var/www/blabla>
        Order deny,allow
        Allow from all
        AllowOverride All
</VirtualHost *:80>

Because nothing happend, I changed the DocumentRoot of the apache server to /var/www (initially was the root document of the first website -/var/www/html) and created a virtual host for the first domain too:

   <VirtualHost *:80>
            DocumentRoot /var/www/html
            ServerName www.first.com
            ServerAlias first.com
        <Directory /var/www/html>
            Order deny,allow
            Allow from all
            AllowOverride All
    </VirtualHost *:80>

In this case, first.com is working ok, but bla.com not.
When I ping blabla.com I get the "unkown host" response. What am I doing wrong? Do I have to modify something in the DNS settings too? Thank you.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Yes, if ping isn't resolving the name, then you'll need to configure DNS for that domain (or a hosts file locally, if you're just trying to test) to point to your Apache server.

share|improve this answer
Thanks! But, why do this happen? I updated the nameservers and they are appearing with whois. Why ping is not resolving the name? –  sica07 Nov 28 '11 at 22:59
@sica07 Can you clarify what's pointed where? The name servers specified in whois are the DNS servers that you're telling the TLD to delegate to for your domain. The entries that you put in there should be DNS servers that are configured to be authoritative for your domain; those systems will be the ones getting the DNS requests for a name of blabla.com or www.blabla.com and sending back a response with the address of your server. Are the servers you're pointing to in the whois entry authoritative DNS servers configured to host your domain? –  Shane Madden Nov 28 '11 at 23:04
Well, the only configuration I've done so far, was to add the Virtual Host. I thought (and read in some tutorials) that it is enough. Could you please help me with a link to some info about how to configure the DNS also? –  sica07 Nov 28 '11 at 23:08
@sica07 Let's back up a sec - do you know where your authoritative DNS is hosted now for first.com? It may be on this system, or it may be a provider's system. That system is where you'd need to point the delegations in the whois registration, and it's where you'll need to configure the blabla.com zone. –  Shane Madden Nov 28 '11 at 23:18
I've done that already. It's on this system, I'm absolutely sure. And in the whois registration I pointed the delegations to this system, also, I made the Virtual Host configs on this system. I just have read in the apache docs, as you already said, that: "You must first have your DNS server properly configured to map those names to an IP address associated with your server." This is one thing I didn't do (sorry for my bad english) –  sica07 Nov 28 '11 at 23:25

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.