Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

What is the best way to add a DNS wildcard record for a domain?

I want example.net, www.example.net, a.b.c.www.example.net, ... going to one server.

Now I use:

example.net.    60  IN  A
*.example.net.  60  IN  CNAME   example.net.

Is it possible to do it simpler?

share|improve this question
What is wrong with what you're currently doing ? –  Iain Apr 29 '14 at 6:44

2 Answers 2

up vote 4 down vote accepted

Either this, or a direct A record (saves one lookup) are the best options you have, yes.

*.example.net.  60  IN  A
share|improve this answer
You still need example.net. in there –  Nils Toedtmann Mar 20 at 13:26

You may be able to use something like DNSmasq and setup: address=/.domain.tld/ http://davejamesmiller.com/blog/linux-installing-dnsmasq-wildcard-local-domains has a guide on setting up DNSmasq (I know from experience DNSMasq is available for Linux and Macs).

Which OS are you running on and what DNS server are you running?

share|improve this answer
Why would he want to get into the DNS service business for a domain with one server? What user or admin problem does it solve? Is is worth the effort? No down vote, but without further explanation, this seems like a solution in search of a problem. –  Scott Leadley Apr 29 '14 at 12:40
It's how I've wildcarded all my development domains. Use DNSmasq and anything *.mydevelopment.tld will go to my development machine. He's obviously running some sort of DNS service (either on his machine for himself, on a server for others or on a third party DNS service): I've given one solution for two out of three possibilities. –  Richy B. Apr 29 '14 at 14:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.