DNS does not forward request to subdomain NS server.

September 24, 2014 1.1k views

Please, help.

  1. I created subdomain dns.emercoin.com, and assigned two custom NS servers to it: seed1.emercoin.com seed2.emercoin.com

It is work. When I test it with dig, answer correct:
[olegh@bsd ~]$ dig dns.emercoin.com NS
dns.emercoin.com. 1229 IN NS SEED2.emercoin.com.
dns.emercoin.com. 1229 IN NS SEED1.emercoin.com.

  1. I run on both servers a prototype of my specialized DNS. This is custom program, works with UDP only, and support DNS from my own DB.

If I ask for DNS-record directly from that server, it works, too:

[olegh@bsd ~]$ dig @SEED2.emercoin.com aaa.dns.emercoin.com
aaa.dns.emercoin.com. 4001 IN A
aaa.dns.emercoin.com. 4001 IN A

(answer IPs aren't correct, this is for test only)

Thus, my custom DNS server works.

  1. When I request same record from my local DNS, request is not reached my custom NS servers, and I receive an empty answer:

[olegh@bsd ~]$ dig aaa.dns.emercoin.com

; <<>> DiG 9.8.3-P4 <<>> aaa.dns.emercoin.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 50374
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;aaa.dns.emercoin.com. IN A

dns.emercoin.com. 430 IN SOA SEED1.emercoin.com. hostmaster.dns.emercoin.com. 1411503131 3600 900 1209600 1800

;; Query time: 5 msec
;; WHEN: Tue Sep 23 18:55:56 2014
;; MSG SIZE rcvd: 91

Can you help me to understand, why DNS requests are not reached my name servers?

1 Answer

How it should be set up:

  • Create NS record for dns.emercoin.com in the zone file that handles emercoin.com
  • Remove any and all sub-domains/A/MX records at said DNS provider that handles emercoin.com for dns.emercoin.com and *.dns.emercoin.com
  • create zone file (assuming BIND) for dns.emercoin.com
  • add zone in /etc/bind/named.conf.local . It will look something like this:
zone "dns.emercoin.com" {
        type master;
        file "/etc/bind/zone.dns.emercoin.com";

zone file should look something like this:

$TTL 500
;$ORIGIN dns.emercoin.com.
@       SOA     localhost.      root.localhost. (
                300100000 ; serial
                21600      ; refresh after 6 hours
                3600       ; retry after 1 hour
                604800     ; expire after 1 week
                86400 )    ; minimum TTL of 1 day
@               IN NS   localhost.
aaa   IN      A
bbb   IN      A
ccc   IN      A

I hope this helps you out.

Have another answer? Share your knowledge.