What is NXDOMAIN Redirection?
NXDOMAIN redirection provides the ability for a recursive server to replace an NXDOMAIN response to a query with a configured answer of its own - usually pointing to a helpful service site. This substitute response is returned to the original client in place of the NXDOMAIN response received by the server.
The ability to configure a redirect zone was first introduced in BIND 9.9.0. (BIND 9 Subscription Version and BIND 9.10 extend this by allowing BIND to provide responses based upon an API to an external user-developed module - for example, DLZ or a coded back-end.
How to set up:
1. Open the guardian CLI and edit: "/data1/etc/namedb/global_include.conf”
vi /data1/etc/namedb/global_include.conf
create the zone of type redirect:
zone "." {
type redirect;
file "/data1/users/admin/db.redirect" ;
};
Note: use shit+ i to insert, then click escape and :wq to save.
2. Change directory to “/data1/users/admin”.
cd /data1/users/admin
3. create the db.redirect file, and add the server name and the redirect IP, in this example I am adding the guardian FQDN and the redirect IP 37.131.20.58, and save the file:
vi db.redirect
$TTL 300
@ IN SOA guard.eip.local. hostmaster.eip.local 0 0 0 0 0
@ IN NS guard.eip.local
*. IN A 37.131.20.58
4. Restart the DNS service:
/usr/local/etc/rc.d/ipmdns.sh restart
5. check the DNS service status
/usr/local/etc/rc.d/ipmdns.sh status
6. test and confirm its working :)