waynefromoakland wrote:
Thanks Mr Hoffman!
I believe I have my answer, now. Thanks for helping me hash this out.
I have a degree in TCOMM management, so I've configured a DNS server or few...in Windows environments.
DNS is DNS. Works the same across all platforms.
Having a degree in telecommunications management does mean that you should be familiar with DNS and DHCP and related technologies, and it also means that you've learned how to research technical topics as you're well aware that Microsoft is not the only vendor, and that the technologies and practices all evolve.
Microsoft did cause problems for more than a few folks by suggesting .local — back when .local wasn't special or reserved — for more than a few Windows Server domains, too. Rather than reserving a domain for local use as they should have requested from ICANN, or encouraging the users to register a domain. Squatting wasn't good practice then, either.
However, Macs are new to me. What I was hoping was that there was a way to automatically run virtual hosts on a mac in a fashion similar to the implementation of the ".local". In other words, with windows, you simply access a machine by it's name.
Windows Server has the ability to add a dynamic address into static DNS — a linkage between DHCP and DNS. OS X doesn't have that. (IIRC, BIND9 server does have the ability to receive those updates, but the DHCP server used with OS X doesn't. The Server.app user interface does not present any of this, however.) OS X uses an entirely different approach here, what's called Bonjour or multicast DNS or mDNS. mDNS avoids the need for a DNS server, which is common among many client networks. Clients all cooperate and provide a name service for themselves using network multicasts. Workable in small networks but — as you're familiar with from telecommunications — not particularly scalable. Given mDNS works differently than DNS, a server that's squatting in mDNS TLD does not work all that well.
Even with the DHCP linkage into DNS as Windows Server provides, few (no?) Windows Server boxes are typically configured with DHCP addresses, which means that those boxes usually have static DNS, which is what we are discussing here for OS X Server. Once you have static DNS configured, tossing aliases — DNS CNAME entries — into the DNS tables is available via the Server.app user interface. With the clients configured to access the server for DNS, those names are then available to all client systems, too.
With a Mac, .local is appended to the machine name. Without knowing anything about .local, I was hoping this granted some sort of "mac power" such that I could easily add VHs to the machine via the Websites interface without DNS configuration...similar to how the default site is available without any DNS configuration at machineName.local.
Okay, now for web services, that approach can and does and will work. Whatever.local does work as a virtual host, as long as Whatever.local has the IP address of the server. Again, that will work because it's a text string that the client sends to the server via the HTTP or HTTPS connection. It's this implementation of virtual hosting that gets folks confused — DNS or hosts to get the IP address, but it's the text string passed over the HTTP or HTTPS connection that matters to the web server.
You can implement fully-working virtual hosts (sites) by tossing all sorts of bizarre names into the client box hosts file too, and creating matching virtual hosts (sites) on the server. No DNS involved. So long as the bizarro names in the hosts file all have the right IP address for the server, the TCP connection will get to the server, and the text string portion of the host name that the user entered into the client as the target URL will get passed to the web server, which will try to match that text string with a virtual host. This never hits DNS at all. The web server can have absolutely no idea what the IP address involved with that text string — if you interpret that text string as a host name — is, too. It's all about that text string that gets passed from the client. This is how virtual hosting works — it's a text string — that the client asks the server for, and the server locates an associated virtual host.
The concern or worry or issue here is that OS X Server itself needs local DNS configured and operating, or the rest of the stack gets flaky. More than a few folks run right past DNS and set up other services, and that usually doesn't end well.
Once you have DNS configured, what you want to do with virtual hosting falls right out of the configuration, too; that all works, too.
But I can stick with the subdomains for now until decide that it's worth it to use my mac server as my primary local DNS.
If you've more than a few boxes such as printers or routers or such, having local DNS services is beneficial in general. Biggest downside being the DNS server(s) have to be available whenever the network is to be available.