There are instances in which a DNS administrator needs to have all hostnames or just non-existent ones for a zone to return the same IP address back to the DNS resolver (DNS client). This can be easily addressed with a wildcard DNS record.
This is a record in a DNS zone that will match requests for non-existent domain names. A wildcard DNS record is specified by using an asterisk (*) as the left-most part of a domain name, i.e. *.company.com. Here is an example of a wildcard record found in the DNS file.
This wildcard DNS record will cause all DNS lookups on the domain name for host records ending in company.com that do not exist to return a value of
192.168.0.3 back to the DNS resolver.
There are limitations when using wildcard DNS record. Asterisks located in other places in the fully qualified domain name (FQDN) will not work as a wildcard.
For example, neither
www.*.company.com work as wildcard DNS records.
Creating a Wildcard record in Windows DNS
To create a wildcard DNS record using Windows DNS, open the DNS Admin console, and navigate until you expand the desired zone. Create a new host (A) record. The name of the record will be
* and then provide the IP address that you wish to resolve all non-existent records for. You can do this for other types of records as well, such as MX.
When using Microsoft Windows 2000 DNS servers, the console will not allow you to use this exact procedure. There are a few ways to work-around this issue.
Using the DNS Admin Console (Windows 2000)
- Right-click on the domain name in the list of domains and choose New Domain.
- Type in
*, for the domain name.
Select the new sub-domain that was created, called
- Right-click it and choose New Host.
- Enter the IP address to associate with the wildcard domain.
- Leave the host name blank.
Dnscmd is one of the tools in the Windows 2000 Support Tools package. To install the Dnscmd command-line tool on your computer, run the
Setup.exe file that is located in the
\Support\Tools folder on the Windows 2000 Server CD. To create the wildcard character record, type the following command at the command prompt, and then press ENTER:
dnscmd servername /recordadd zonename * A IPAddress
In this command,
servername is a placeholder for the name of the DNS server,
zonename is a placeholder for the zone name where the record will be created, and IPAddress is a placeholder for the address that the wildcard character record must point to when the DNS server reads the record.
/recordadd option is used to add a new record to the zone. The A option specifies the host address resource record.