Hacker News new | ask | show | jobs
by eric59 4087 days ago
How is a wildcard subdomain configured?
4 comments

Something along lines of

  *	IN	A	<ip_address>
A simple DNS configuration would be:

An A record * .domain.com -> IP address

and in Nginx on the server with that IP address

server {

        listen          80;

        server_name     domain.com *.domain.com;
It depends on your DNS provider as to if they support it or not. Often, they will not and you'll simply have to run your own dns nameserver (bind) with a wildcard config, such as http://community.aegirproject.org/dnswildcard ... Googling around will find you many bind configurations and discussions of this feature.
Have the glue record for a/your domain (e.g. c.uk) point to your own nameserver. Configure the nameserver to respond to any request for an A or AAAA record under that domain with the target IP address. Make the HTTP server listening on that IP address answer regardless of the Host header.