Setting Up a Custom DNS for Testing Purposes

These are the files I used to configure a test DNS to reply to all DNS requests for ANY .com to my test server.

Once this is up and running just configure each server’s /etc/resolv.conf file to point to this server.

[root@ats-check ~]# cat /etc/named.conf
options {
# listen-on port 53 { 127.0.0.1; };
# listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
# memstatistics-file "/var/named/data/named_mem_stats.txt";
# allow-query { any; };
# allow-transfer { localhost; 2.2.2.2; };
recursion no;

dnssec-enable yes;
dnssec-validation yes;
dnssec-lookaside auto;

/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";

managed-keys-directory "/var/named/dynamic";
};

zone "com" IN {
type master;
file "all.com.zone";
allow-update { none; };
};

zone "test000000.com" IN {
type master;
file "test000000.com.zone";
allow-update { none; };
};

# 10.22.190.90
zone "190.22.10.in-addr.arpa" IN {
type master;
file "/var/named/190.22.10.rev";
allow-update { none; };
};

logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};

zone "." IN {
type hint;
file "named.ca";
};

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";

include "/etc/rndc.key";

[root@ats-check ~]# cat /var/named/all.com.zone
$TTL 816400
@ IN SOA com. root.test000001.com. (
100 ; serial
1H ; refresh
1M ; retry
1W ; expiry
1D ) ; minimum
@ IN NS ns1.test000001.com.
@ IN A 172.19.107.164
ns1 IN A 172.19.107.164
@ IN MX 10 mail.test000001.com.
mail IN A 172.19.107.164
WWW IN A 172.19.107.164
* IN A 172.19.107.164

[root@ats-check ~]# cat /var/named/190.22.10.rev
$TTL 86400
@ IN SOA test000000.com. root.test000000.com. (
100 ; serial
1H ; refresh
1M ; retry
1W ; expiry
1D) ; minimum
@ IN NS ns1.test000000.com.
1 IN PTR binggo.test000000.com.

[root@ats-check ~]# cat /etc/resolv.conf

#nameserver 10.255.250.11
#nameserver 10.255.251.11
#search dc1.corp.gd jomax.paholdings.com hosting.corp.gd gdhosting.gdg int.godaddy.com
nameserver 127.0.0.1

[root@ats-check ~]# cat /var/named/test000000.com.zone
$TTL 86400
@ IN SOA test000000.com. root.test000000.com. (
100 ; serial
1H ; refresh
1M ; retry
1W ; expiry
1D ) ; minimum
@ IN NS ns1.test000000.com.
@ IN A 10.22.190.90
ns1 IN A 10.22.190.90
@ IN MX 10 mail.test000000.com.
mail IN A 10.22.190.90
WWW IN A 10.22.190.90