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 am wanting to setup a internal development server (LAMP), I need the web team to be able to access different developments sites ie:

example1.local example2.local example3.local etc

from within the network.

I believe it would be something to do with DNS?


locked by HopelessN00b Jan 21 '15 at 9:05

This question exists because it has historical significance, but it is not considered a good, on-topic question for this site, so please do not use it as evidence that you can ask similar questions here. This question and its answers are frozen and cannot be changed. More info: help center.

closed as off-topic by HopelessN00b Jan 21 '15 at 9:05

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

Solution 1: create a "hosts" file containing:

yourip  example1.local 
yourip  example2.local 
yourip  example3.local

then copy this hosts file to every workstations that need to access ".local" fake-domain

Solution 2: set a closed-view name system (only your network could query).

Solution 3: try ns delegations on sub-domains.

ok, i presume you are talking about the windows hosts file? how would it load the different sites on the server? – Kyle Hudson Mar 21 '10 at 17:31
If you use apache it can be could done by using virtualhost. "Hosts" doesn't only works for windows, it can be in linux (/etc/hosts) too. – Ta Coen Mar 22 '10 at 6:16
hosts file as the first option? Bad idea. Too much trouble and maintenance. – John Gardeniers Mar 22 '10 at 8:16
Yes, I agree with you John. But it's for "example3.local" isn't? – Ta Coen Mar 22 '10 at 12:53

I've done this in my last few significant development servers.

I use dbdns to setup a DNS server under my control on the server, with the 'tinydns' and 'dnscache' programs running.

In tinydns, I setup a custom/local top-level DNS space (/service/dnscache/root/data):

# Nameservers for the local TLDs
# an address for the machine
# TLD and a second level DNS wildcard
# some have specific addresses

Then, I tell dnscache where to look for *.virtual domain names car of the file: /service/dnscache/root/servers/virtual

 # which IP address tinyDNS runs on

Now, going to bill.virtual (or anything else not specifically give) will return

Set the address of the dnscache server as the local name servers and you too should be able to ping the address of bill.virtual - and then you can have those names picked up with Apache to serve websites.

Thanks for the reply, I am not sure where to start with your solution :( – Kyle Hudson Mar 21 '10 at 17:06
info on installing: – Alister Bulman Mar 21 '10 at 21:19

You need to use name based virtualhosts in your apache config to make the httpd server serve the correct websites according to the dns correponding name.

For the name resolution to work, if you don't own a dns server you can adjust the hosts file on the client workstations.

Hope this helps.


While there are a number of ways to go about this DNS is the best, as it will give you an open-ended system that does not require any changes on the clients. If you already have an internal DNS server simply create a new zone with the appropriate settings and records.

If you don't already have an internal DNS server you'll find BIND is very easy to install and configure on Linux. If you have a Windows server you could use the Windows DNS on that.


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