wildcard dns
From my blog.
I’m having this problem where I can’t get the CNAME *.domain.tld working on Mac OSX server 10.8
I'll illustrate my problem (presuming web service is up and running):
Let’s set up a new “Primary Zone” with an “A Record”.
- Server.app
- DNS
- +
- Add Primary Zone
- Name: domain.tld
- Done
- +
- Add Machine Record
- Zone: domain.tld
- Host Name: domain.tld
- IP Addresses: 127.0.0.1
- Done
- Visit http://domain.tld/ in Safari
That’s great, now we can find the domain by visiting the browser, but how about www.domain.tld?
No can do.... But this is logical 😉
Let’s add a CNAME (or “alias Record”)
- Server.app
- DNS
- +
- Add Alias Record
- Zone: domain.tld
- Host Name: www
- Destination: domain.tld
- Done
- Visit http://www.domain.tld/ in Safari
Now we can find domain.tld as well as www.domain.tld in the browser.
This is just great, it almost looks like a full Enterprise Webserver!!
Now I want to add *.domain.tld so I can find all.these.sub.domains.domain.tld as well, of maybe just dev.domain.tld or test.domain.tld or even www2.domain.tld
- Server.app
- DNS
- +
- Add Alias Record
- Zone: domain.tld
- Host Name: *
😕
The by most people much beloved GUI does not accept the * so I’ll just type “asteriks” in stead and change it in the terminal later.
- Host Name: asteriks
- Destination: domain.tld
- Done
- Terminal.app
- # sudo nano /private/var/named/db.domain.tld
- change "asteriks.domain.tld" to "*.domain.tld"
- Server.app
- DNS
- OFF
- ON
The “GUI” now reflects the zonefile.
I can now resolve anything.domain.tld, but not for long… 😟
The problem
The problem is that periodically or after a service/machine restart, the *.domain.tld CNAME will be undone because Apple does not like it when I change things I’m not "supposed" to change. 😢
The issue I have with this problem is that *.domain.tld is widely accepted in Bind/DNS systems except for Mac OSX server Mountain Lion.
Incom”Apple”ble…..
Conclusion
Apple OSX Server is NOT enterprise ready because it fails on a number of accounts (Bind, Samba) to offer the functionalities a 'real world' enterprise *NIX server offers.
Apple "Server Support"
I have spoken to Apple Server Support in Ireland who only know how to handle the GUI, so very friendly, but not very helpful! 😐
Please feel free to discus this issue in this thread of on my blog.
Message was edited by: OcchioNL
Mac Mini Server 10.8-OTHER, OS X Server, 10.8