BIND should be able to do this by 'fooling' it into thinking it is authoratative for a higher level zone, such as com
, for example.
zone "com" { type master; file "/etc/bind/files/catch_all.db"; };
Then, in your catch_all.db
file:
$TTL 300
@ IN SOA ns1.domain.example. hostmaster.domain.example. (
2012020301 ; serial
6H ; refresh
1H ; retry
2W ; expire
6H ; minimum
)
IN NS ns1.domain.example.
IN NS ns2.domain.example.
* IN MX 10 mail.domain.example.
mail IN A 10.0.0.2 ; Your mail server's IP.
* A 10.0.0.1 ; The IP you want all domains to resolve to.
This will apply to any request for a domain in the com
zone that hits your server. You can do the same for other top-level zones as well:
zone "net" { type master; file "/etc/bind/files/catch_all.db"; };
zone "org" { type master; file "/etc/bind/files/catch_all.db"; };
zone "co.uk" { type master; file "/etc/bind/files/catch_all.db"; };