1

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?

3

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.

1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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