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.

My current DNS configuration has the blank hostname as well as www going to the VPS's IP address, and they're being served up fine. mail has a CNAME that goes to Google Apps for convenience purposes.

Is there anyway to specify that any other subdomain (is that the right word) like foobar.mydomain.com goes to a particular IP?

I'd like to do this so I can add new subdomains on the fly through Apache rather than having to explicitly declare it in the DNS entry, which is my current option. Are there any major reasons why I should avoid this wildcarding?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

It is a poor idea, and I'd really strongly urge you to continue to continue to make the DNS records.

The problem you are creating is that it then becomes impossible to detect an invalid host name, since every possible host name on that domain is now valid. This consequence will be felt across all protocols not just for web traffic.

One particular example is if you have any windows shares that you access through NetBIOS names, you will cease to be able to access them by name, as the DNS will resolve the name, rather than as before failing and then windows trying the WINS server / broadcasting.

Likewise testing for a new machine on the network - checking its DNS name is up and ready, give it a quick ping - yep that worked, ohh no it didn't, you just successfully ping'ed the webserver.

share|improve this answer
    
Thanks! This is exactly the answer I was looking for! Your NetBIOS note is beyond my current comprehension (no worries; thanks for the example), but the second point about adding new machines is a very reasonable one. Interestingly, the hosting providers I have worked with for my clients (e.g., MediaTemple) have this catchall behavior. I suppose it's for ease of the webmaster in adding subdomains on the fly, but you definitely provide a strong reason why not to do it. –  Steven Xu Nov 21 '10 at 1:43

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.