Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

I have a virtual host in ubuntu with a dedicated ip. How can I make it host a domain name or several domains for example I want to point the nameserver setup of to my virtual host. How can I do that ? I already have configured a lampp apache in this virtual host. And I can access the host with ip.

Let me know if I have to clarify more.

share|improve this question

migrated from Jun 8 '11 at 21:01

This question came from our site for professional and enthusiast programmers.

You are mixing up 2 completely different topics. Apache VHosts aren't in any way related to a DNS set up. In fact you can have have IP based VHosts, Port Based VHosts and Name based VHosts -- only the latter do absolutely need a working DNS setup. May I suggest you decide on one topic here, and post a second question with the other topic? – Server Horror Jun 8 '11 at 21:10
up vote 0 down vote accepted

You need to declare your virtual hosts in your Apache configuration. See Apache Virtual Host documentation.

share|improve this answer
yea, but don't my virtual host have to have nameserver configuration which I will set in the domain ns1 and ns2 configuration ? – rbncha Jun 8 '11 at 5:52
The DNS servers for your would require A records pointing to your dedicated IP address so clients can find your host. Apache then uses the contents of the Host header sent by the client to select a virtual host to serve. – JamesA Jun 8 '11 at 6:11
that means I will need to set the ns1 and ns2 for to the virtual server ip ? same ip for both ns1 and ns2 ? – rbncha Jun 8 '11 at 7:10
No you will set the ns1 and ns2 to whatever DNS you are using to host your domain. You will create an A record in that DNS to point to your virtual server ip. – JamesA Jun 8 '11 at 20:55

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.