The Domain Name System is maintained by a distributed database system, which uses the client–server model. The nodes of this database are the name servers. Each domain has at least one authoritative DNS server that publishes information about that domain and the name servers of any domains subordinate to it. The top of the hierarchy is served by the root name servers, the servers to query when looking up a top-level domain. wikipedia
One records an IP address as of a domain, or more typically, a subdomain of a domain one "owns". This is done by adding an address "A record" for that domain. Wildcard subdomains are handy for wiki server farms because a new site will be created for each new subdomain. wikipedia
Wildcard A records. wikipedia
See Certificates for wildcard auth.
See Proxy for configuring server-side routing.
See Login for configuring OAuth provisioning for each domain to be hosted by a server but not subdomains when they will share the same authorization.