Question about A-record * wildcard and subdomains

futurevision

Verified User
Joined
Nov 26, 2008
Messages
50
Hey DA-users :)

I am busy finetuning my DA installation and untill now its working great. At this point there is one thing I don't understand.

I got domain.com (example ofcourse) and I want to add the subdomain test.domain.com. I did just that in DA and it was not working, not after 30min even. Then I figured that subdomain didnt have an A-record pointing to the server. I added the test.domain.com A-record and it was working, good. But...it would be really stupid if I had to do that for every subdomain a customer wants to add (it should go automaticly). I decided to create a * A-Record and bam, working like a charm!

But the problem is: when I visit doesntexists.domain.com a page is showing with "Apache is functioning normally" on it. I understand why, but I want that to display a 404 errorpage since the subdomain wasnt added.

What do I have to do to make this work the way I want? Thanks in advance for helping me out :)

---
Oh, and maybe I found a bug or something in DA but I tried some subdomains and removed the afterwards (as user) but when I visit the DNS section (as admin) the removed subdomains are still there...?
 
You will have to edit the index.html that is the main virtualhost on that ip address. I dont know where that file is probably /var/www/html/index.html or something. You could just delete it.
 
DA takes care of the DNS config on the server where it lies.
Subdomains that aren't hosted shouldn't have a DNS record, using the * wildcard is not a good answer to your problem (even if you put a page saying "This subdomain doesn't exist").

If your DNS is hosted elsewhere, use AXFR to transfer the zone of domain.com to those servers and change the SOA+NS authority records to match the destination. That's the best choice.
 
Thanks for your fast reply! I changed the content to a blank page now, if I remove it it will display the contents of the directory so thats not an option ;)

I thought that maybe there was a better solution or something. On a different server where I am customer i got cPanel and that does return a real 404 page on an invalid subdomain. How do they do that then ?

tillo: all DNS info is hosted on a different server so i assume i cant use the built-in DNS options from DA. Thats just the way the provider works (Leaseweb, Netherlands) i guess. Their controlpanel doesnt have options for AXFR, only for A, MX, CNAME, TEXT.
 
Last edited:
You would have to make the default with virtualhosts:

Options -Indexes

to not show folder contents.
 
Back
Top