Wildcard DNS zone in bind

Wildcard DNS zone will act as authoritative DNS for any domain name. This is useful when you have a service like domain name parking service, where customers will change name servers of their domain name to your private label name servers. You need all thse domains get resolved to a specific IP address with out manually configuring DNS zone for each of the domain name.

Install Bind DNS server.

On Ubuntu/Debian

On CentOS/RHEL

Create a Catch-All zone file.

Add following content to the file

In above, replace

YOUR_IP_ADDR_HERE = IP you need all domains resolve to.
yourdomain.com = replace with your private label name server domain.

To make this zone active, you need to add it to named.conf, edit

On CentOS

On Debian

At the end of the file, add

Verify there is no error.

Restart bind

Now verify Catch all DNS zone works with

It should resolve to the IP address specified in DNS zone file catch-all.zone. In above example, i used serverok.in for testing, you can use any domain, that should resolve to the IP address.

If you need to set MX rcord for the domains, you can add following to end of catch-all.zone file

See bind

Leave a Reply

Your email address will not be published. Required fields are marked *