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

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 http://dyndns.org? Without access to our local DHCP server, what's the best practice way to do this?

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

Essentially, you've already cracked it. Assuming that your CentOS box has the address 1.2.3.4, 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 1.2.3.4

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

share|improve this answer
add comment

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
add comment

Your Answer

 
discard

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.