How would I go about setting up an A record for in Bind9 for any negative queries? I want to forward our staff to an informational page if they were to visit a non existent domain. We have an internal caching server.

  • 7
    Separate from the answer, you should know that NXDOMAIN redirection is an extremely controversial practice. – Hyppy Dec 11 '14 at 18:06
  • Generally speaking, my answers here are as a private individual and not as an employee of ISC. However, in this particular instance I'd like to say, speaking as someone from ISC, that Hyppy is correct on both counts (his answer below, and his comment above.) We added features for NXDOMAIN redirection to BIND because customers were demanding it, not because we think it's a swell idea. But if you must do it, BIND does support it. – Michael McNally Dec 15 '14 at 6:14

There is an article here on setting up NXDOMAIN redirects: BIND 9.9 redirect zones (for NXDOMAIN redirection).

Here is the example as given by ISC, but full explanation is available on their page.

In named.conf, you add a new "zone":

zone "." {
    type redirect;
    file "db.redirect" ;

And then in that zone file db.redirect, you populate it with your answer:

$TTL 300
@ IN SOA ns.example.net hostmaster.example.net 0 0 0 0 0
@ IN NS ns.example.net
; NS records do not need address records in this zone as it is not in the
; normal namespace.
*. IN A
*. IN AAAA 2001:ffff:ffff::

Instead of *., you can narrow down TLDs and domains. For example, if you only want failed .co.uk addresses to be redirected to a specific address:

*.CO.UK. IN AAAA 2001:ffff:ffff::

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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