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 dev box that runs Apache for lots of different sites. We currently access these through http://centos/project-name. I'd like to switch to http://project-name.centos.

I've set up virtual hosts on Apache so http://project1.centos serves the right pages. Unfortunately every time we want to add a new project we have to edit /etc/hosts (or the Windows equivalent) on about 10 different machines).

We don't have control over our local DHCP / DNS server but I could set something up (another DNS server?) on the CentOS box and I'm happy having a single entry in /etc/hosts.

Is it possible to maake other machine's requests to anything.centos point to the CentOS box's IP address?

Alternatively, am I going about this completely the wrong way? Should I use something like Without access to our local DHCP server, what's the best practice way to do this?

share|improve this question
up vote 3 down vote accepted

Essentially, you've already cracked it. Assuming that your CentOS box has the address, set up a local DNS server which is authoritative for the zone .centos., and forwards all other requests to your existing local DNS servers.

In the zone .centos., serve a single record

*.centos.      3600 IN A

And make sure that both the CentOS box and the local Windows boxes use for DNS resolution.

share|improve this answer

MadHatter hit the nail on the head. I would add, point the workstations at the centos nameserver so their local resolver talks to your new dns server instead of the existing nameserver. You might also want to read about iterative v.s. recursive queries and dns server caching.

share|improve this answer

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.