How to wildcard DNS records in Windows Server DNS to catch all records

wildcardwindows-dns

My friend creating a White-Label-Website and he asked me if they can wildcard all domain so the buyer only set their domain NS, point to their DNS server, and the DNS server return single IP for all request if non exists…

Since i had my own server and i happen to have Windows Server with DNS launched too, i tried several way, but non resolve…

I had a .(root) zone, i add a * folder and and new host too it… didn't worked…
I also create * and . zone recently and and add Empy host record to them with the IP address i want, that didn't worked too either…

What should i do?

Best Answer

I am afraid it is not working as you suppose to ...

There is nothing link "general catch all" record in DNS system. There is defined wildcard as "all the rest" or if you want catch all but it works just as a record (one level of domains) and it cannot be used for subdomain(s).

Let say you have domain example.com. Zone file contain following records :

$TTL 3H
@   IN SOA  @ admin.example.com. (
                    0   ; serial
                    1D  ; refresh
                    1H  ; retry
                    1W  ; expire
                    3H )    ; minimum
    IN NS   @
    IN A    127.0.0.1
    IN AAAA ::1
a   IN A 127.0.0.2
*   IN A 127.0.0.3

in case you will request DNS you will get these answers

example.com => 127.0.0.1
a.example.com => 127.0.0.2
b.example.com => 127.0.0.3
xyz.example.com => 127.0.0.3
www.b.example.com => NXDOMAIN (error Not Existing Domain)

The reason of the error (last example) is that subdomain doesn't exists. Wildcard cover <anything>.example.com but it is not cover any subdomain so it is not covering <anything>.<else>.example.com...

Your question expect catch all record over even more then one domain level so I am afraid there is no way how to achieve this goal :-(.